http://www.perlmonks.org?node_id=978029


in reply to Re^2: how to remove everything before last slash in perl?
in thread how to remove everything before last slash in perl?

The fact that you began with this…

s{.*(/)}{$1};

…and ended up with this…

s{^.*/}{};

…makes me suspicious that you both started and ended by using someone else's regular expression pattern, and that you understand neither one.

My advice: Avoid copy and paste programming. Sometimes, it's better to figure out how to do something yourself than it is to ask someone else how to do it. You learn more this way.