Help for this page

Select Code to Download


  1. or download this
    # Using hard references
    my @cat = (1,2,3);
    ...
        # On second iteration, $array will contain a reference to @dog.
        # On third iteration $array will contain a reference to @pig.
    }
    
  2. or download this
    # Using a hash
    my %animals = (
    ...
        #    Second iteration, pig will be handled.
        #    Third iteration, cat will be handled.
    }