Hello Monks, I am trying to create local variable and get following error message while in use strict mode.
#!/usr/bin/perl -w use strict; ref_test1(); sub ref_test1 { local $type="connect"; print "Here in ref_test1.\n"; ref_test2(); } sub ref_test2 { print "Type: $type\n"; print "Here in ref_test2\n"; }
OUTPUT:
Global symbol "$type" requires explicit package name at ./zz.pl line 8.Global symbol "$type" requires explicit package name at ./zz.pl line 15.
In reply to Unable to declare local variable with "use strict". by mr_p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |