Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
However, this next code shows two copies of the hash correctly;my $code = 'use Data::Dumper; print Dumper \%serial_of;'; eval $code;
Any other reference to the hash also seems to let eval see it correctly. Obviously this is a problem since if I knew the names of the hashes in advance, I wouldn't need to use eval in the first place. This code is being run in conjunction with Damian Conway's Class::Std module, which may or may not make a difference (if it does, I don't see how).use Data::Dumper; print Dumper \%serial_of; my $code = 'use Data::Dumper; print Dumper \%serial_of;'; eval $code;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Eval doesn't see lexicals
by tilly (Archbishop) on Nov 02, 2005 at 02:22 UTC | |
by Anonymous Monk on Nov 02, 2005 at 02:43 UTC | |
by tilly (Archbishop) on Nov 02, 2005 at 02:53 UTC | |
by dave_the_m (Monsignor) on Nov 02, 2005 at 10:39 UTC | |
|
Re: Eval doesn't see lexicals
by BUU (Prior) on Nov 02, 2005 at 01:14 UTC | |
by Anonymous Monk on Nov 02, 2005 at 01:56 UTC | |
by chromatic (Archbishop) on Nov 02, 2005 at 02:15 UTC | |
by Anonymous Monk on Nov 02, 2005 at 02:20 UTC | |
by tilly (Archbishop) on Nov 02, 2005 at 02:26 UTC | |
|
Re: Eval doesn't see lexicals
by rir (Vicar) on Nov 02, 2005 at 02:18 UTC |