On Jul 30, 2014, at 1:23 PM, Martin G. McCormick wrote: > I thought that one could test for an empty or undefined array > against the @arrayname but it looks like doing that always > succeeds if it is set with my or our @arrayname.
You can test for an empty or an undefined array. Any array in scalar context will evaluate to the number of elements of the array. An 'if' or 'unless' statement will put the testing expression into scalar context, so in the statment 'if(@array)', @array will be evaluated in scalar context. If the array has any elements, even just one that is undef, @array will evaluate to true. There must be something else going on. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/