Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: file name parsing to get the original file name

by Abigail-II (Bishop)
on Aug 20, 2003 at 21:22 UTC ( #285298=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://285298]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-09-20 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (163 votes), past polls