in reply to bit of help with map function
Barring that, that's not how map functions work. Map takes a list and performs an operation on each element, returning the result. You are thinking of it more as a foreach, which is not what it's intended for. If you really want to use map, you could use an iterator and return an empty list:
or force it into a grep:my $i = 1; my @names = map {++$i > 6 ? $_ : () } @input2arr;
my $i = 1; my @names = grep {++$i > 6} @input2arr;
But neither of these is particularly transparent.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|