in reply to Re: scalar in list context
in thread scalar in list context

There is no difference between @list= 1,2,3,4; and @list=(1,(2,3,(4)));

Careful! Precedence makes a big difference between those two. You're thinking of @array = (1, 2, 3, 4) versus @array = (1, (2, 3, (4))).

Replies are listed 'Best First'.
Re^3: scalar in list context
by LanX (Saint) on Jan 26, 2010 at 23:19 UTC
    Wow thanks a lot.

    Indeed, the = has a higher precedence than comma ...

    UPDATE: what I really wanted to show is that  sub list1 { 1,2,3,4 } and  sub list2 { (1,(2,3,(4))) } return the same result. The parens are not necessary to produce a list but are saver and often better to read...

    Cheers Rolf