use Scalar::Util; my $is_blessed = blessed $obj;