#!/usr/bin/perl -w use strict; my $ref = getaref(); print "ref points to $$ref\n"; my $refb = getaref(); print "refb points to $$refb\n"; print "ref still points to $$ref\n"; sub getaref { my $a = int(rand(100)); print "a in sub is $a\n"; return (\$a); } __END__ a in sub is 89 ref points to 89 a in sub is 28 refb points to 28 ref still points to 89 (the memory for the value of 89 is separate from the memory of the value of 28)