I think the way you are going is pretty elegant, here is a version altered to return false(0) on an empty array
perl -le'@a=(a, {}, {});print (( @a==grep {ref $_ eq "HASH"} @a ) ? @a ? 1 : 0 : 0)'Cheers,
R.
In reply to Re: How to test all elements in a list are hashes?
by Random_Walk
in thread How to test all elements in a list are hashes?
by bsdz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |