Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by rir (Vicar)
on Sep 01, 2010 at 13:36 UTC ( [id://858335]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ## perl 5.10.1
    use strict;
    ...
    grep $ary[$_ ], @ary;  # no warning
    
    grep $ary[$oo], @ary;  # warns
    
  2. or download this
    ## perl 5.10.1
    use strict;
    ...
    grep {$ary[$_ ]} @ary;  # no warning
    grep {$ary[$oo]} @ary;  # warns
    

Log In?
Username:
Password:

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

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

    No recent polls found