in reply to How do you replace variables in an external string?
If not, I believe you can't use method calls inside a string, and expect it to interpolate, use an temp variable, such as:my $line = 'Hello $cgi->param("name"), how are you today?';
and then:my $name = $cgi->param('name');
If making an temp variable for each param, then a nice hash will do: (Untested)my $line = "Hello $name, how are you today?";
And then you can just use $cgiform{name}.my %cgiform; for my $key ($cgi->param) { $cgiform{$key} = $cgi->param($key); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: How do you replace variables in an external string?
by Kanji (Parson) on Apr 04, 2002 at 19:20 UTC |