(And yes, File::Basename is the way to go in this case)my $path = 'c:\\folder1\\filename.doc'; my ($file) = ($path =~ /([^\\]*)$/);
UPDATE: Corrected /([^//]*)$/ to /([^\\]*)$/, thx FunkyMonk
In reply to Re^2: Get last occurence of a character in a string
by pjotrik
in thread Get last occurence of a character in a string
by theroninwins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |