[Belfast-pm] Template Toolkit, passing in a hash?

Marty Pauley marty+belfast-pm at kasei.com
Tue Jul 6 19:08:55 CDT 2004


On Tue Jul  6 10:36:15 2004, Simon McCartney wrote:
> 
> Garbage collection in Perl is beyond me, I convinced my perl leaks memory
> at a huge rate...

Perl uses reference counting garbage collection.  It will leak memory if
you have a self-referencing data structure.  For example:

  my %data = ( foo => "bar" );
  $data{loopy} = \%data;

Each instance of %data will survive until Perl exits.  If you want it to
be gc'd you need to undef $data{loopy}.

-- 
Marty



More information about the Belfast-pm mailing list