in reply to Re: trouble with packages/eval/variable-scoping
in thread trouble with packages/eval/variable-scoping
Thanks a lot, LanX!
So I changed the sub loadP to the following, and it works :-)
Rata (having learned something today)
sub loadP
{
$gold = 0; # <--- new
my $savefile = new FileHandle("xxx.ptysav", "r");
my $lines = join("",($savefile->getlines()));
my $result = eval $lines;
close ($savefile);
}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: trouble with packages/eval/variable-scoping
by ikegami (Patriarch) on Aug 29, 2024 at 15:29 UTC | |
by LanX (Saint) on Aug 29, 2024 at 16:11 UTC | |
by ikegami (Patriarch) on Aug 29, 2024 at 17:00 UTC |