Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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?
[MidLifeXis]: Has anyone been successful running prove under Windows with a --jobs parameter? It appears, even with (what appears to be) appropriately- configured parameters and up to date Test::Harness/TAP ::Harness that tests are still running serially.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2016-12-06 17:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (112 votes). Check out past polls.