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:
but the better choice remains File::Basename.$file =~ s{.*/}{}s;
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re^2: remove directory path
by polettix
in thread remove directory path
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |