in reply to Re: Uninitialized Value Error When Interleaving
in thread Uninitialized Value Error When Interleaving

what if you try this:
#!/usr/bin/perl use warnings; use strict; my @foo = ( 1 , 3 , 5 , 7 ); my @bar = ( 2 , 4 , 6 , 8 ); print STDOUT my @foobar = map { $_, shift @foo } @bar;

Replies are listed 'Best First'.
Re3: Uninitialized Value Error When Interleaving
by bikeNomad (Priest) on Jul 03, 2001 at 03:08 UTC
    Um, that's exactly what I had (that is, "perl -w" is the same as "use warnings"). But as I and others have said, it's not usually a great idiom, as it's destructive to @foo. And you'll still have undefined values if @foo is shorter than @bar.