No such thing as a small change | |
PerlMonks |
Re: file name parsing to get the original file nameby Abigail-II (Bishop) |
on Aug 20, 2003 at 21:22 UTC ( [id://285298]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|