good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: file name parsing to get the original file nameby Abigail-II (Bishop) |
on Aug 19, 2003 at 20:34 UTC ( [id://285020]=note: print w/replies, xml ) | Need Help?? |
This is suboptimal. First, it isn't right on all platforms.
On UNIX, a file or directory name could contain a backslash,
but your regex splits on backslashes. Second, it's inefficient. If you want to take the last element of a list,
take the last one, instead of first reversing the list, then
putting into an anonymous array, then take the first element
of that. As I indicated elsewhere in this thread:
Abigail
In Section
Seekers of Perl Wisdom
|
|