use UNIVERSAL qw( isa ); .... my $is_blah = isa( $thing, 'Some::Class' ) && $x == 3; ... if ( isa($value, 'HASH') || isa($value, 'ARRAY') ) { # Do something here } #### use Scalar::Util qw( blessed reftype ); ... my $is_blah = blessed( $thing ) eq 'Some::Class' && $x == 3; ... my $r = reftype( $value ); if ( $r eq 'HASH' || $r eq 'ARRAY' ) { # Do something here }