La12 has asked for the wisdom of the Perl Monks concerning the following question:
I applied the following code in my script: print STDOUT my @foobar = map { ( $_, shift @foo ) } @bar; and it worked, but when I turn on use warnings; I get the following error: Use of uninitialized value in print at line 3 I've done some research and it seems that some people just complain about using warnings and turn them off (I don't want to do that), and other say to re-work the code into a while loop. Anyone have any advice as to how I can keep the code while getting rid of the error?@foo = ( 1 , 3 , 5 , 7 ); @bar = ( 2 , 4 , 6 , 8 ); @baz = map { ( $_ , shift @bar ) } @foo;
|
|---|