if (ref $val eq "HASH") { ... }
or if you wish to also accept values that are "hashref-like" (e.g. blessed hashrefs, objects overloading %{}), then:
use Scalar::Does; if (does $val, "HASH") { ... }
In reply to Re: function input may be hash ref
by tobyink
in thread function input may be hash ref
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |