and then the use of my works in the first case.
This seems unlikely. What happens when you declare a variable with "our" or "use vars" and then declare it again with "my" is that the second one essentially replaces the first one for the remainder of that scope. So if you refer to the variable through a sympolic reference, you get the global one, but if you refer to it directly you get the lexical one. For example,
use vars qw($B);
my $A='B';
my $B=7;
my $C=${$A};
print "A = $A - B = $B - C = $C\n";
prints "A = B - B = 7 - C =" This happens because no value is ever assigned to the global variable called $B. Wacky, huh? | [reply] [Watch: Dir/Any] [d/l] |