in reply to Uninitialized Value Error When Interleaving
Unless, that is, you left the @baz line in. Note that you are destroying @foo in the process (by calling shift); if you do it more than once, you'll have an empty array the second time.#!/usr/bin/perl -w 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'. | |
|---|---|
|
Re: Re: Uninitialized Value Error When Interleaving
by La12 (Sexton) on Jul 03, 2001 at 02:51 UTC | |
by bikeNomad (Priest) on Jul 03, 2001 at 03:08 UTC |