http://qs1969.pair.com?node_id=753352


in reply to Tracking down memory leaks in Perl Devel::Leak

This leaks one object every time you hit return, then tells you how many scalars there are. (The memory leaks because $bar has a reference to itself, and so its reference count will never reach 0.)
#! /usr/bin/perl -w use strict; use warnings; use Devel::Leak; while(1) { my $count = Devel::Leak::NoteSV(my $foo); print "$count"; <>; my $bar; $bar = \$bar; }