my $name = "/usr/local/bin/perl";
(my $basename = $name) =~ s#.*/##; # Oops!

after substitution $basename is supposed to be
perl

but why it is not /local/bin/perl? will .*/ matches longest possible string?

Thank you list!

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to