There is no magic here and map() has no special knowledge of $1 or any other number variable. Regular expression matches in list context return the contents of any matched grouping. In your case you have exactly one capture group so m// returns $1 which becomes the return value of the map() block and viola!, map() uses $1. But only indirectly.
In reply to Re: maps implicit "$1-handling"
by diotalevi
in thread maps implicit "$1-handling"
by tos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |