use Scalar::Util qw( blessed reftype ); sub comparifier { blessed $_[0] eq blessed $_[1] && reftype $_[0] eq reftype $_[1] && $_[0] eq $_[1] }