unfortunately one of the variables is set in an "include" file which is pulled by 'require'. Can I make this work? E.g.
==== main.pl ====
use strict;
my $ReqVar;
my $LocVar;
require include_file.pl;
$LocVar = $ReqVar;
<<at this point I'd like $LocVar to be foo,
but when strict and my are used $LocVar is blank
although it IS set to foo when 'my' is omitted>>
==== end of main.pl ====
==== include_file.pl ====
$ReqVar = "foo";
1;
==== end of _include_file.pl ====
thanks for hints -- I've read APP for 'strict' and 'require' and don't know if there's actually a solution. I'm constrained by this being existing code, which works when 'strict' and 'my' are not used. (It looks like 'our' in 5.6 would do this, but we're stuck at 5.003)
Alan
In reply to scope / strict / my / require by anadem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |