freddo411 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl use strict; my $name = "Fred"; my @infile = <DATA>; my $tmpl = join '', @infile; # output print $tmpl; __DATA__ This is my template. Here is my $name
which spits out:
This is my template. Here is my $name
And what I'd like is "...Here is my Fred"
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Interpolating $var in a $string
by perrin (Chancellor) on May 27, 2004 at 17:45 UTC | |
|
Re: Interpolating $var in a $string
by dragonchild (Archbishop) on May 27, 2004 at 17:56 UTC | |
by freddo411 (Chaplain) on May 27, 2004 at 21:20 UTC | |
|
Re: Interpolating $var in a $string
by pizza_milkshake (Monk) on May 27, 2004 at 17:54 UTC | |
|
Re: Interpolating $var in a $string
by eclark (Scribe) on May 27, 2004 at 18:05 UTC | |
|
Re: Interpolating $var in a $string
by ChrisR (Hermit) on May 27, 2004 at 17:47 UTC | |
|
Re: Interpolating $var in a $string
by RandomMonkey (Initiate) on May 27, 2004 at 18:37 UTC | |
|
Re: Interpolating $var in a $string
by qq (Hermit) on May 27, 2004 at 20:22 UTC | |
|
Re: Interpolating $var in a $string
by dimar (Curate) on May 28, 2004 at 02:43 UTC |