sub hashref { eval { \%{$_[0]} } } sub myfunc { hashref($_[0]) or die "myfunc expected a hashref"; }