in reply to Re: Uploading Time (getting last element of a variable)
in thread Uploading Time

If one really wants to do it with a regex, a much better way would be
$fullname = "C:\\apple\\index.htm"; my ($file) = $fullname =~ m!([^/\\]+)$!; print $file;
Zero backtracking here. However, Macs are still going to be a problem (paths are separated with doublecolons there, right?), so File::Basename is what one should use.
use File::Basename; # I ain't afraid of no ghosts.. $fullname = "C:\\apple\\index.htm"; my $file = basename $fullname; print $file;
____________
Makeshifts last the longest.