Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Treating a variable as a variable in a regular expression?

by InfiniteSilence (Curate)
on Jul 08, 2014 at 13:13 UTC ( #1092718=note: print w/replies, xml ) Need Help??


in reply to Treating a variable as a variable in a regular expression?

perl -e 'sub foo {return qq|abracadabra|}; my $line = qq|hi there: sub +|; if($line=~s/sub/&foo/eg){print $line};'

Prints

hi there: abracadabra

Celebrate Intellectual Diversity

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2022-01-17 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?