in reply to Removing duplicate hashrefs from an array

Hmm, I have almost never used the smart match operator. For a very long time, I could not use it because I could not upgrade to a Perl version supporting it. By the time I could finally upgrade, the smart match operator had become deprecated (or, rather, labeled, experimental and subject to changes), so that I prefer not to use it, and you should probably do the same.

Having said that, and keeping in mind that I've never used smart match for anything but just quickly testing it out of curiosity, I would think that comparing an array with an hash ref (i.e. a scalar containing a reference to an hash) is probably unlikely to work. Maybe you would need to dereference the hashref before using it. But I may be completely wrong on that. An additional consideration is that your hash or hashref should be declared before entering the foreach loop.

Anyway, given the experimental nature of the smart match, using a hash or a hash of hashes (depending on what type of uniqueness you exactly need) in the traditional idiomatic Perl way is likely to be a more robust and lasting solution.