Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Difference in Hash Declaration

by jwkrahn (Monsignor)
on May 07, 2012 at 11:02 UTC ( #969241=note: print w/replies, xml ) Need Help??


in reply to Re: Difference in Hash Declaration
in thread Difference in Hash Declaration

Parenthesis () creates LIST:
print 1, 'b', 3, 'd', 5, 'f', "\n";

I see a list there but I don't see any parentheses.

my @stuff = map $_ + 2, 6, 7, 8, 9, 10;

Ditto

Parentheses are used for precedence.

my %h = ( 1 => 'j', 2 => 'b' );

There the assignment operator has higher precedence than the comma operator so the parentheses are required.

Replies are listed 'Best First'.
Re^3: Difference in Hash Declaration
by anazawa (Scribe) on May 07, 2012 at 12:25 UTC
    I agree with you. Parentheses don't create LIST, are used for precedence. I'm glad you pointed out my mistake :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://969241]
help
Chatterbox?
[Sinistral]: I think that just the sight of his username now causes a downvote storm. I agree, and the gratuitous use of formatting does make reading hard. I've given him +1 on things where there seemed to be actual good advice, but I think the big
[Sinistral]: nail in coffin was the rant against a Schwarzian Transform
[stonecolddevin]: at best, from what i've seen, his knowledge is accurate up to maybe 2002. the sheer volume of words is mostly worthy of a downvote in most cases though i think
[erix]: ITYM Schwartzian Transform :P
[erix]: hey planetscape :)
[planetscape]: howdy stonecolddevin, erix
[Sinistral]: eric Aye. I thought I typed that wrong. All hail Randall! I listen to him on FLOSS Weekly
[Discipulus]: i think his vacuus, trombon like, absence of meaning, joined with a ostentatious style, after many years irritates the most
[erix]: easy to get wrong -- I guess that was sund's point, too :P
[Discipulus]: planetscape welcome back! (or is well comeback?)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-06-22 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (530 votes). Check out past polls.