in reply to Re^2: The difference between my and local
in thread The difference between my and local
I am getting following error, when I use strict and use $tt instead of $a
My Code:-
My Error:-use strict; my $tt = 3.14159; { local $tt = 3; print "In block, \$tt = $tt\n"; print "In block, \$::tt = $::tt\n"; } print "Outside block, \$tt = $tt\n"; print "Outside block, \$::tt = $::tt\n";
Can't localize lexical variable $tt at basic.pl line 4.
In Section
Tutorials