Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello the following code produces warnings when run with -w could I please get an explanation on how to properly and eloquently deal with and undefined array?
use strict; use warnings; my @array = undef; if (@array eq undef) { print }; if (@array ne undef) { print }; foreach (@array) { print; } map { print } @array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question about foreach/iterating/verifying an undefined array
by GrandFather (Saint) on May 21, 2011 at 23:26 UTC | |
|
Re: Question about foreach/iterating/verifying an undefined array
by LanX (Saint) on May 21, 2011 at 23:17 UTC |