in reply to How to test all elements in a list are hashes?
? What about:my @a = bless([], "HASH");
? The broadest way to tell if something is a hashref is...to see if it's a hashref:{package HASH; use overload "%{}"=>sub{$_[0][0]}} my @a = bless([{}], "HASH");
All untested.print @$x == grep({eval {\%$_}} @$x),"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to test all elements in a list are hashes?
by bsdz (Friar) on Jan 17, 2005 at 23:14 UTC |