chr defaults to using $_, so use: @a = map f( $_ ), @numbers;.
Or define f() to default to $_:
sub f(_){ $_[0]+1 };
Now my @a = map f, @numbers; works.
In reply to Re: map sub to list?
by BrowserUk
in thread map sub to list?
by pldanutz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |