A Brief Aside about Memory Management
- Perl takes care of this for you
- variables are reference counted
- freed when reference drops to 0
- stay alive as long as they have at least one reference
- allows tricky bits
my $ref; { my $x = 1; $ref = \$x; }
print $$ref;
- $x is still around -- well, the value is, because $ref points to it
Slide 43 of 47