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

Re^3: grep with looped tests

by LanX (Saint)
on Jun 06, 2014 at 16:03 UTC ( [id://1089053]=note: print w/replies, xml ) Need Help??


in reply to Re^2: grep with looped tests
in thread grep with looped tests

Ah I always forget that List::Util (which is core) has now any , too!

(I'm still hooked on List::MoreUtils , see next answer :)

> my @res = grep {my $line = $_; !defined first {$line =~ $_} @re } @data;

But I think you'd certainly prefer any over first to avoid !defined ! :)

update

though first was and any wasn't part of my 5.10 distribution!

Cheers Rolf

(addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-24 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found