Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
"be consistent"
 
PerlMonks  

Re: Re: Code Smarter

by I0 (Priest)
on Dec 31, 2000 at 17:41 UTC ( [id://49117]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Code Smarter
in thread Code Smarter

m/\.mp3$/or substr($_,-4)eq".mp3"

Replies are listed 'Best First'.
Re: Re: Re: Code Smarter
by ichimunki (Priest) on Dec 31, 2000 at 19:17 UTC
    Anyone know which of these is the faster expression (intuitively speaking, not looking for a benchmark)? Doesn't the RE have to do a lot of work to get to the end of each string passed, whereas substr simply clips? The only thing to remember is to either test .MP3 as well or do lc() on the substr().
      My Benchmark shows the RE slightly faster.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://49117]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.