Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: grep {CONSTANT} @list

by LanX (Bishop)
on Nov 21, 2012 at 20:42 UTC ( #1005003=note: print w/replies, xml ) Need Help??


in reply to grep {CONSTANT} @list

you are confusing a regex data-type with a regex operation.

grep {REGEXP} uses a code-block which returns a regex which is always true if defined.

grep {/string/} uses a m// (match operation) which defaults to test $_.

Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005003]
help
Chatterbox?
[choroba]: I don't even remember the beginning
[choroba]: someone told me to use perl instead of sed for something, and several years later, I'm developing a huge Tk application
[Discipulus]: choroba started in primary school to get some advantage in the future..
[choroba]: nono, I programmed in Basic at the primary school, on my Commodore 116/16
[Discipulus]: ;=)
[choroba]: then learned some assebly on the same machine, then moved to my father's PC (XT with a Hercules card), used Turbo Pascal a lot

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2018-06-22 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (123 votes). Check out past polls.

    Notices?