Thanks for replying. I guess I wasn't clear enough. Actually, the two $a variables are supposed to be unrelated. The "my $a" is hypothetically a reasonably appropriate name chosen for the variable given its meaning, but it happens to conflict with perl's use of global $a.