Do not use & unless you know what you are doing.
Running your code under strict and warnings yields a message about using defined for arrays and invites to use just @a.
use strict; use warnings; sub test { undef; } my @a = test; if (@a) { use Data::Dumper; print Dumper \@a; } __END__ $VAR1 = [ undef ];
I hope this answers your question.
--
David Serrano
In reply to Re: if (defined @arr) problem
by Hue-Bond
in thread if (defined @arr) problem
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |