Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: grep { $var } @arr

by igelkott (Priest)
on Jul 21, 2014 at 07:10 UTC ( [id://1094427]=note: print w/replies, xml ) Need Help??


in reply to Re: grep { $var } @arr
in thread grep { $var } @arr

/$pat/g

Perhaps I've misunderstood but with my current $var, using /$pat/g will result in no matches (with or without the 'g' modifier). As far as I know, this will look for the literal string of '$_ < 3' on my array, as written below (appending to the initial script).

@res = grep {/$pat/g} @arr; print "Search:\t@res\n";

This finds none of the elements of @arr.

Log In?
Username:
Password:

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

How do I use this? • Last hour • Other CB clients
Other Users?
Others lurking in the Monastery: (None)
    As of 2026-10-17 08:29 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      • hippo‥ epoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
      • erzuuli‥ Anonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.