in reply to Behaving appropriately based on ref() result
You could also use the reftype function from Scalar::Util. This has the advantage of
for example:
use Scalar::Util qw(reftype); my $o=bless {},MyClass; print ref $o # prints "MyClass" print reftype($o) # prints "HASH"
|
|---|