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


in reply to Re: The difference between my and local
in thread The difference between my and local

That code doesn't compile. TEST starts with double quotes and ends with a single quote. If I fix that, this works as expected for me. Here's a version you can run with your $x argument given on the command line:

use strict; my $x = shift(@ARGV); my $a = "TEST"; if ($x == 1) { $a = "one"; } elsif ($x == 2) { $a = "TWO"; } else { $a = "EMPTY"; } print "a=$a\n";