use strict; use warnings; use File::Spec; my $item = 'L:\My-Folder\foo.txt'; my($vol, $path, $file) = File::Spec->splitpath($item); print "Vol = $vol, path = $path, file = $file";