I have a problem in Perl I don't understand. I stripped it down to this very short code.
Why does Perl's map
function return an empty array? Shouldn't it return an array with 9 undef
s?
sub mySub{
return;
}
my @arr = (1 .. 9);
my @arr2 = map( mySub($_), @arr );
print @arr . ' ' . @arr2, "\n";
It prints "9 0".
It is probably something simple, but perldoc is not helping.