in reply to Re: Answer: How do I extract a file name from a path string
in thread How do I extract a file name from a path string
I wholeheartedly agree:
A pattern match will not be as platform-aware (or as readable, incidentally) or as thorough as the above code, which is not significantly longer.use File::Spec::Functions; my $fname = '/home/legato/filename.pl'; my ($vol, $path, $filename) = splitpath($fname); # $filename now contains 'filename.pl'
Anima Legato
.oO all things connect through the motion of the mind
|
|---|