Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 browsing the Monastery: (2)
As of 2024-03-19 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found