http://qs1969.pair.com?node_id=416272


in reply to The difference between my and local

This brings me to the problem I've been having. I have a "my" variable that I want to update within an if..elsif, but it does not get updated.
my $a = "TEST'; if ($x == 1) { $a = "one"; } elsif ($x == 2) { $a = "TWO"; } else { $a = "EMPTY"; }
However, $a is not getting updated. I'm obviously overlooking something in either declaring the variable to be global, or some way to reference the variable directly. I just don't quite know where to look. Anyone???