Help for this page

Select Code to Download


  1. or download this
    my $ref;
    {
    ...
    
    $ref = undef;  # The scalar stops referencing the array,
                   # so it's freed here.
    
  2. or download this
    my @outer;
    for (1..2) {
    ...
    
    print "@{ $outer[0] }\n";  # pass 1
    print "@{ $outer[1] }\n";  # pass 2
    
  3. or download this
    for (1..10) {
        my $r1;
    ...
    }
    
    # You have just leaked 30 variables.