KISS! s/map/grep/ ;-)
my @ans = map { (sumdigits($_) % 2) ? $_ : () } @input;
... my @ans = grep { sumdigits($_) % 2 } @input; ...
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: Newbie question
by LanX
in thread Newbie question
by oldB51
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |