use strict; use warnings; sub f($) { return $_ [0] + 1 }; my @a = (1, 2, 3); map (f, @a)
As some would say, "why not working?" I get Not enough arguments for main::f at -e line 1, near "f," Yet perldoc -f map says
@chars = map(chr, @numbers);How is one different from the other?
In reply to map sub to list? by pldanutz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |