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

Re^2: Is there a way around grep?

by suaveant (Parson)
on Oct 11, 2011 at 15:53 UTC ( #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 (Chancellor) on Oct 11, 2011 at 22:42 UTC
Re^3: Is there a way around grep?
by ikegami (Pope) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930850]
[erix]: s/$/ :)/
[ovedpo15]: regex question - how can I delete everything until string "here" (including "here") for all the string (not until the first pattern)? for example a/here/b/here/c will return "/c"
[LanX]: Eily is Breton?
[erix]: 'spas
[hippo]: s/.*here//;

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (16)
As of 2018-07-17 13:28 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (366 votes). Check out past polls.