liorlew has asked for the wisdom of the Perl Monks concerning the following question:
hi, I am running the following code:
use strict; use warnings; my $newvar=0; if (defined $undefvar) { $newvar = $undefvar; }
and getting the following error:
Global symbol "$undefvar" requires explicit package name at C:\Users\l +iorlew\Desktop\perl\fixes\scripts\test.pl line 5. Global symbol "$undefvar" requires explicit package name at C:\Users\l +iorlew\Desktop\perl\fixes\scripts\test.pl line 7.
this is not the first time I used this functionality, but I do not seem to find what is wrong with the code.
Thank you,
Lior
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: if defined not working
by choroba (Cardinal) on Feb 04, 2016 at 15:45 UTC | |
|
Re: if defined not working
by stevieb (Canon) on Feb 04, 2016 at 15:47 UTC | |
|
Re: if defined not working
by Athanasius (Archbishop) on Feb 04, 2016 at 16:02 UTC | |
by 1nickt (Canon) on Feb 04, 2016 at 16:39 UTC | |
by stevieb (Canon) on Feb 04, 2016 at 17:01 UTC | |
by mr_mischief (Monsignor) on Feb 04, 2016 at 17:38 UTC |