sub is_same_ref_str { $_[0] eq $_[1] } sub is_same_ref_num { $_[0] == $_[1] } $_ = \$_; print +( "not ", "" )[ is_same_ref_str( $_, "$_" ) ], "the same reference\n"; print +( "not ", "" )[ is_same_ref_num( $_, "$_" ) ], "the same reference\n"; __END__ the same reference not the same reference