Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Curious about Hashes which viewed as a list has only one item

by BrowserUk (Patriarch)
on Feb 29, 2008 at 00:02 UTC ( [id://671056]=note: print w/replies, xml ) Need Help??


in reply to Curious about Hashes which viewed as a list has only one item

It's effectively identical to %foo = ( {} => undef );.

If strict/warnings were in force, it would have il elicited:

%foo = {};; Reference found where even-sized list expected at ...

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Curious about Hashes which viewed as a list has only one item
by chrism01 (Friar) on Feb 29, 2008 at 01:33 UTC
    Actually, that would be 'elicited', although in this context, I like the way you're thinking, that would be a good word if it existed ;)
Re^2: Curious about Hashes which viewed as a list has only one item
by ack (Deacon) on Feb 29, 2008 at 05:34 UTC

    Thanks, BrowserUk. That was what I suspected would be the case...just wasn't sure if it would be undef or something else.

    Your note on the complaining message from Perl had the strict warnings been in effect also tells me what I had hoped would be the case...it recognizes that there aren't the even number of entries in the list to allow it to be a 'normal hash'. Errto also noted a similar expectation (though a different message).

    Thanks everyone. That really relieves my curiosity.

    ack Albuquerque, NM

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 22:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found