Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Odd behavior in hash initialization due to missing parens

by naikonta (Curate)
on Oct 09, 2007 at 10:21 UTC ( [id://643658]=note: print w/replies, xml ) Need Help??


in reply to Odd behavior in hash initialization due to missing parens

Welcome to the greediness of list construct.

The commas in the hash are pair separator. After the sprintf they become argument separator for sprintf, and without the parens it lasts until the last scalar (48 in this case). With parens, the commas as argument separator for sprintf are only before the closing paren. The closing paren itself acts as argument terminator for sprintf, separating it as an execution unit from the rest of the pairs. After the closing paren, commas become pair separator again.


Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found