Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Do you know where your variables are?
 
PerlMonks  

matching a variable containing metacharacter treated as character

by docdurdee (Beadle)
on Feb 21, 2013 at 16:10 UTC ( #1019974=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @subfoos = grep{m/$var/} @foos;
    
  2. or download this
     
    my $regvar  = $var; $regsol =~ s/\./___/g;
    my @subfoos = map {s/___/\./g; $_} 
                  grep{m/$regsol/} 
                  map{s/\./___/g; $_}@foos;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1019974]
Approved by toolic
Front-paged by MidLifeXis
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-04-19 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls