Q&A > strings > How do I extract a file name from a path string - Answer contributed by vaevictus
open FILES, "dir /b /aa /s |" or die;
while ( <FILES> )
my( $dir, $file ) = /(.+)\\(.+)/;
defined $file or next; # no path separator
print "$dir => $file\n";
There is no Extraterrestrial life
There aren't any suitably capable Extraterrestrials
Interstellar travel is too difficult
We're too uncool / not worth the trouble
What do you mean they haven't visited?
Results (463 votes). Check out past polls.