in reply to How to compare an empty key with another empty key in associative array
$b = {}; is not an associative array. An array containing other arrays may look something like this:
my @two_d_array = ([$x,$y,$z],[1,2,3],['a','b','c']);
To see if an array is empty, you can check it's scalar value for contents.
my $elements = scalar(@two_d_array);
UPDATED: Associative array is considered a hash in Perl, (thanks choroba),
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to compare an empty key with another empty key in associative array
by choroba (Cardinal) on Oct 24, 2012 at 11:51 UTC |