Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: grep {CONSTANT} @list

by frozenwithjoy (Curate)
on Nov 21, 2012 at 19:52 UTC ( #1004997=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    say grep { REGEX } @list;
    #doesn't work, because it isn't really doing what you think it is doin
    +g
    ...
    my $regex = qr/string/;
    say grep { /$regex/ } @list;
    #this works (and, as expected, gives same bad result you got if // is 
    +removed)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-12-29 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (194 votes), past polls