my @x; # @x has a refcount of 1 { my @array=(\@x); # @x has a refcount of 2 } # Free lexicals # @x has a refcount of 1 #### procedure refcount_dec(item) if ( --item.refcount == 0 ) foreach sv in item.contents refcount_dec(sv) endfor if ( item.isref ) refcount_dec(item.references) endif endif endproc