http://qs1969.pair.com?node_id=858336


in reply to uninitialized $_ sneaks past warnings in grep/map block or expression

If you understand the rule that it's ok to copy undef to another variable, but not use it in an operation, all of these make perfect sense.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

  • Comment on Re: uninitialized $_ sneaks past warnings in grep/map block or expression

Replies are listed 'Best First'.
Re^2: uninitialized $_ sneaks past warnings in grep/map block or expression
by ikegami (Patriarch) on Sep 01, 2010 at 14:05 UTC

    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 $_.