use Scalar::Util qw(blessed); if ( blessed( $value ) and $value->can( 'parent' ) ) { # }