in reply to Re: remove directory path
in thread remove directory path

The File::Basename approach is better IMHO - more readable, portable and tested.

In the regex, you're bound to be in some Unix flavour; moreover, it misses files in the root directory, because of the "+". I'd reword it as:

$file =~ s{.*/}{}s;
but the better choice remains File::Basename.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.