in reply to Perl Garbage Collection, again

FYI, the reason nothing is released in the first snippet is:
{ my $foo = 'X' x 100000000; <-- a lexical var $foo getc; } undef $foo; <-- the package var $foo was my $foo = ""; already undef so does nothing getc;

You would have wanted

{ my $foo = 'X' x 100000000; getc; undef $foo; } getc;