use v5.16; use strict; use warnings; use Scalar::Util (); package Foo::Bar 1.2 { ...; my $addr = Scalar::Util::refaddr($ref); # use fully-qualified name because not imported }