http://www.perlmonks.org?node_id=284899


in reply to Re: file name parsing to get the original file name
in thread file name parsing to get the original file name

That's not very flexible. I can understand not needing to care about separators from different platforms, but your approach only works if you have two directories and then the file. It will fail if there's just one directory, or three.

my $filename = "one/two/three/four/five/six.a"; my $name = (split m{/} => $filename) [-1];

Abigail