in reply to Re: Re: file name parsing to get the original file name
in thread file name parsing to get the original file name

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

  • Comment on Re: file name parsing to get the original file name