I'm still surprised that Perl can match against '/' several times (split) faster than it can skip to the last '/' with a single rather simple match.
I'm not surprised. /(^\/+)\z/ is a rather complicated regex due to the character class being used. The optimizer can't figure out that is the same as "looking for the last slash". m!/! on the other hand is so simple, the optimizer recognizes it as searching for a fixed string.
Abigail
In reply to Re: file name parsing to get the original file name
by Abigail-II
in thread file name parsing to get the original file name
by tja_ariani
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |