Using defined on an aggregate's been out of fashion for a good while now.
$ perl -e 'use strict;use warnings;my @foo;if( defined @foo ) { print +"foo" }' |& splain defined(@array) is deprecated at -e line 1 (#1) (D deprecated) defined() is not usually useful on arrays because i +t checks for an undefined scalar value. If you want to see if the array is empty, just use if (@array) { # not empty } for example. (Maybe you should just omit the defined()?)
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re^3: To test empty array in perl
by Fletch
in thread To test empty array in perl
by siddheshsawant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |