use File::Spec; ( $volume, $directories, $file ) = File::Spec->splitpath( $path );