Help for this page

Select Code to Download


  1. or download this
    my @a = qw( a b c d );
    my $i = sub { @a ? splice(@a, 0, 2) : () };
    while (my ($x,$y) = $i->()) {
       print("$x:$y\n");
    }
    
  2. or download this
    my @a = qw( a b c d );
    my $i = sub { @a ? splice(@a, 0, 2) : (undef,undef) };
    while (my ($x,$y) = $i->()) {
       print("$x:$y\n");
    }