Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How can one re-parse(?) a string to fill in variables

by kilinrax (Deacon)
on Nov 23, 2000 at 23:07 UTC ( [id://43154]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
     
    ...
    my $greeting = 'Hello $name!';
     
    print $greeting;
    
  2. or download this
    #!/usr/bin/perl -w
     
    ...
    $greeting =~ s|\$([\w_]+)|eval "\${$1}"|e;
     
    print $greeting;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found