Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Unexpected warning

by samwyse (Scribe)
on Nov 18, 2013 at 16:14 UTC ( #1063143=note: print w/replies, xml ) Need Help??


in reply to Re^3: Unexpected warning
in thread Unexpected warning

The undef value is subtly different from using an undefined variable, so that may be causing the problem.

tst($foo{undef});  # doesn't warn from tst

This uses the undef value as a key into the %foo hash; the key presumably doesn't exist so Perl returns undef. This is working as I would expect.

tst($foo{$undef});  # warns from tst

This looks up the value of $undef, which presumably isn't defined, so Perl should flag an error at that statement, not inside tst. If that is the case, then it, too, is working as I would expect.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2020-11-28 05:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?