Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: m{} within grep{} causing problems?

by mikfire (Deacon)
on Jun 25, 2001 at 19:48 UTC ( #91318=note: print w/replies, xml ) Need Help??


in reply to m{} within grep{} causing problems? (code)

You are confusing perl. According to perldoc -f grep, you have two choices:
grep BLOCK LIST grep EXPR,LIST
Your usage is a hybrid of the two, as the curly braces indicate the beginning of a block. Both of these two forms work
scalar( grep m[\d{3}-\d{3}], values %batch_ids ) == 6;
or
scalar( grep { m[\d{3}-\d{3}] } values %batch_ids ) == 6;

mikfire

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://91318]
help
Chatterbox?
Eily just learned that you get a message when replying to yourself
[Eily]: "Hey I got an answer!" => "Oh, right, it's me..."
[stonecolddevin]: good morning all
[Eily]: good morning stonecolddevin :)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-11-22 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (327 votes). Check out past polls.

    Notices?