in reply to How to test all elements in a list are hashes?

is there an elegant way to avoid the empty list from returning true

Well, elegant, I don't know; beauty is in the eye of beholder. If you don't want the empty list to return true, then test for it:

@$x and @$x == grep { ref $_ eq 'HASH' } @$x

- another intruder with the mooring in the heart of the Perl