swares has asked for the wisdom of the Perl Monks concerning the following question:
This code would create these perl statements which I would need to have it execute.use CGI; %var_name = ( opp => 'Operation', name => 'Name', ); for $vname (keys %var_name){ $statement='$'.qq!$vname = param('$vname')!; # this did not work eval{ $statement }; # nor did this ${statement}; print "$vname is $${vname}<br>\n"; }
$opp=param('opp'); $name=param('name');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to do dynamic stuff with perl
by Skeeve (Parson) on Oct 20, 2005 at 10:10 UTC | |
|
Re: How to do dynamic stuff with perl
by blazar (Canon) on Oct 20, 2005 at 10:34 UTC | |
|
Re: How to do dynamic stuff with perl
by revdiablo (Prior) on Oct 20, 2005 at 15:05 UTC | |
by swares (Monk) on Oct 21, 2005 at 04:42 UTC |