Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Is there a way around grep?

by suaveant (Parson)
on Oct 11, 2011 at 15:53 UTC ( [id://930850]=note: print w/replies, xml ) Need Help??


in reply to Re: Is there a way around grep?
in thread Is there a way around grep?

Of course, if only looking for a match a good addition would be a last to break the loop as soon as a match is found.

Or use List::Util::first

                - Ant
                - Some of my best work - (1 2 3)

Replies are listed 'Best First'.
Re^3: Is there a way around grep?
by AnomalousMonk (Archbishop) on Oct 11, 2011 at 22:42 UTC
Re^3: Is there a way around grep?
by ikegami (Patriarch) on Oct 15, 2011 at 08:26 UTC
    If you're looking for speed, I bet grep is normally faster than for+last.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-23 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found