Help for this page

Select Code to Download


  1. or download this
    @foo = ( 1 , 3 , 5 , 7 );
    @bar = ( 2 , 4 , 6 , 8 , 9);
    print STDOUT my @foobar = map { ( $_, shift @foo ) } @bar;
    
  2. or download this
    @foo = ( 2 , 4 , 6 , 8 );
    @bar = ( 1 , 3 , 5 , 7, 9);
    $len = @foo;
    print STDOUT my @foobar = (
            (map { ( $_, shift @foo ) } @bar[0 .. $len - 1]),
            @bar[$len .. $#bar]  );