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 ( #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
Re^2: uninitialized $_ sneaks past warnings in grep/map block or expression
by ikegami (Pope) 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
Node Status?
node history
Node Type: note [id://858336]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2014-07-25 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (171 votes), past polls