use strict; use warnings; use Ref::Util 'is_blessed_ref'; use Test::More tests => 9; ok ! is_blessed_ref (undef), 'No: undef'; ok ! is_blessed_ref (0), 'No: false'; ok ! is_blessed_ref (1), 'No: true'; my ($x, @x, %x); ok ! is_blessed_ref (\$x), 'No: scalar ref'; ok ! is_blessed_ref (\@x), 'No: array ref'; ok ! is_blessed_ref (\%x), 'No: hash ref'; bless \$x, 'Foo'; bless \@x, 'Foo'; bless \%x, 'Foo'; ok is_blessed_ref (\$x), 'Yes: blessed scalar ref'; ok is_blessed_ref (\@x), 'Yes: blessed array ref'; ok is_blessed_ref (\%x), 'Yes: blessed hash ref';