That explains the first, but undef isn't being copied in the map and grep statements. The OP doesn't know that map and grep set $_.
In reply to Re^2: uninitialized $_ sneaks past warnings in grep/map block or expression
by ikegami
in thread uninitialized $_ sneaks past warnings in grep/map block or expression
by rir
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |