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.
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???my $a = "TEST'; if ($x == 1) { $a = "one"; } elsif ($x == 2) { $a = "TWO"; } else { $a = "EMPTY"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: The difference between my and local
by steves (Curate) on Dec 20, 2004 at 19:42 UTC | |
by sanPerl (Friar) on Oct 17, 2006 at 11:28 UTC | |
by davorg (Chancellor) on Oct 17, 2006 at 11:54 UTC | |
by shmem (Chancellor) on Oct 17, 2006 at 11:40 UTC | |
by ikegami (Patriarch) on Oct 17, 2006 at 15:11 UTC | |
by Nazeerahamed (Initiate) on Oct 06, 2012 at 16:15 UTC | |
by Anonymous Monk on Apr 15, 2018 at 04:32 UTC | |
Re^2: The difference between my and local
by Anonymous Monk on Feb 05, 2014 at 04:14 UTC |
In Section
Tutorials