Running that code with the second line alone works fine for me (Perl 5.6.1).
I suspect that your problem is that the use of shift in the map *destructively* processes the @foo array -- shift pulls the first element of the array out of @foo, so when you go to do the shift trick again, you're processing an empty array. You can see this if you add the following code after the first 'interleave':
my $foo_size = @foo; print "\nThere are now $foo_size elements in \@foo\n";
In this case, warnings told you about something very important!
perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'
In reply to Re: Uninitialized Value Error When Interleaving
by arturo
in thread Uninitialized Value Error When Interleaving
by La12
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |