Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: updating a variable call in a hash table

by GrandFather (Saint)
on Feb 09, 2009 at 03:50 UTC ( [id://742341]=note: print w/replies, xml ) Need Help??


in reply to Re^3: updating a variable call in a hash table
in thread updating a variable call in a hash table

It doesn't matter where your template string comes from, it's still a string containing some markup.

It's the same question with the same answer: use a templating system. Consider:

use warnings; use strict; for my $color (qw(green blue red puce)) { my $text = "The color is COLOR\n"; $text =~ s/COLOR/$color/g; print $text; }

prints:

The color is green The color is blue The color is red The color is puce

Perl's payment curve coincides with its learning curve.

Log In?
Username:
Password:

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

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

    No recent polls found