in reply to hashref with(out) arrays

"Best practice" is a matter of opinion (see various threads here regarding PBP). That said, I suppose Ref::Util is the best bet.

#!/usr/bin/env perl use strict; use warnings; use Ref::Util 'is_arrayref'; my $item = { x => 'a', y => ['b', 'c'] }; for my $key (keys %$item) { if (is_arrayref $item->{$key}) { print "Value for $key is an arrayref\n"; } else { print "Value for $key is not an arrayref\n"; } }