in reply to Re: The number of references to a variablein thread The number of references to a variable
use Devel::Peek qw(SvREFCNT); $x = 42; $y = \$x; $refs_for_x = SvREFCNT($x); print "$refs_for_x\n"; [download]