Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by merlyn (Sage)
on Sep 01, 2010 at 13:39 UTC ( [id://858336]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://858336]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found