Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Creating dynamic variables

by Corion (Pope)
on Jan 03, 2013 at 09:52 UTC( #1011429=note: print w/replies, xml ) Need Help??


in reply to Creating dynamic variables

Maybe you want a templating system instead? sprintf is the simplest one, and it could be used in your case as follows:

$foo = "hello"; my $x = "$foo%s"; my $output = sprintf $x, $y; # replaces "%s" with $y print $output;

There are many, many more templating systems, with varying easy of use and complexity. I recommend looking at simple string substitution first.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2016-08-30 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (411 votes). Check out past polls.