Help for this page

Select Code to Download


  1. or download this
    {
        my @array = ( 1, 2, 3, 4, 5 );
        print "\@array is in scope: @array\n";
    }
        print "\@array is out of scope: @array\n";
    
  2. or download this
    foreach ( 1, 2, 3 ) {
        my @array;
    ...
        print "\@array has been assigned: @array\n";
        print "\@array is now falling out of scope; contents gone forever.
    +\n";
    }