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

Re^3: why lexical variables can not be interpolated?

by kennethk (Abbot)
on Oct 21, 2013 at 17:16 UTC ( [id://1059147]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $text =~ s/\$(\w+)/$$1 * 2/egx;  #I tried to double the age and succee
    +ded!
    
  2. or download this
    $AGE = 17;
    $tmpl = 'I am %s years old';      # note single quotes
    $text = sprintf $tmpl, $AGE * 2;  # print I am 17 years old
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-19 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found