Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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

Replies are listed 'Best First'.
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?
[choroba]: Re: Modern Perl 4th Edition Perl Cookbook is a very bad cookbook, I wasn't able to finish any dish and the resulting meals were disgusting.
[Happy-the-monk]: Discipulus: why are you looking for a Danish monk?
[1nickt]: choroba really you did not like it hm?

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2017-11-17 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?