in reply to Re: Re: Uninitialized Value Error When Interleaving
in thread Uninitialized Value Error When Interleaving
Watch this. It's your code with two small modifications:
When you run this, notice that the list is going to have a trailing ",". That's because join() knows there's an element after the 8 (undef!) and makes a slot for it. And notice the error changed, its now an uninit value in join.use warnings; use strict; my @foo = ( 1 , 3 , 5 , 7 ); my @bar = (0, 2 , 4 , 6 , 8 ); my @foobar= map { $_, shift @foo } @bar; print STDOUT join(',', @foobar);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Uninitialized Value Error When Interleaving
by La12 (Sexton) on Jul 09, 2001 at 18:07 UTC |