Help for this page

Select Code to Download


  1. or download this
    my @a = qw(1 2 3 4 5);
    while ((my $a, @a) = @a) {
    ...
    $a is now 3, and @a is now (4)(5)
    $a is now 4, and @a is now (5)
    $a is now 5, and @a is now ()
    
  2. or download this
    while (@a) {
        my $a = shift @a;
        # Use $a ...
    }