explodec14 has asked for the wisdom of the Perl Monks concerning the following question:
I have read file into memory and I would like to replace some strings in it (i call them placeholders) with some others of my own. I would like know if there is a way to do this with a single line which will include all the needls/placeholders and all the replacements. I mean without run the following on each placeholder:
$my_text =~ s/some_placeholder/the_replace/g
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replace placeholders in text in an elegant manner
by CountZero (Bishop) on Feb 27, 2010 at 20:12 UTC | |
by explodec14 (Novice) on Feb 27, 2010 at 20:32 UTC | |
by GrandFather (Saint) on Feb 28, 2010 at 00:15 UTC | |
|
Re: Replace placeholders in text in an elegant manner
by repellent (Priest) on Feb 28, 2010 at 03:22 UTC | |
by CountZero (Bishop) on Feb 28, 2010 at 08:42 UTC | |
|
Re: Replace placeholders in text in an elegant manner
by ww (Archbishop) on Feb 27, 2010 at 19:25 UTC | |
by explodec14 (Novice) on Feb 27, 2010 at 20:22 UTC | |
|
Re: Replace placeholders in text in an elegant manner
by AnomalousMonk (Archbishop) on Feb 28, 2010 at 05:46 UTC |