in reply to evaluating a string into the executing program
What's the bigger picture? That is: what is it that you want to use this technique to achieve? What you have at present (apart from @${arrayname} should probably be @$arrayname)
It may be that you are trying to do something like:
my @FOO; routine (); print "@FOO"; sub routine { my $arrayname = "FOO"; my $string = "\@$arrayname = ('foo', 'bar');"; eval $string; }
Prints:
foo bar
If so, don't. Almost certinally there are better ways to do it, whatever it is.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: evaluating a string into the executing program
by deorth (Scribe) on Jul 14, 2007 at 01:00 UTC | |
by dsheroh (Monsignor) on Jul 14, 2007 at 01:47 UTC | |
by deorth (Scribe) on Jul 14, 2007 at 04:33 UTC |