develooper Front page | perl.perl5.porters | Postings from March 2003

Thought on operator precedence

Thread Next
From:
Claes Jacobsson
Date:
March 13, 2003 05:04
Subject:
Thought on operator precedence
Message ID:
8894D5F6-5553-11D7-AA98-000A959B4130@ppm.nu
Hey,

according to perlop, concatenation has the same level of precedence as 
+ and -.

$i = 0;
$v = "foo" . $i + 1;       # feels more natural for "foo1" instead of 
$v = "foo" . ($i + 1)

I know this is not a bug, just an annoying feature. Does anyone really 
have a use for + - and . having same precedence or would it be wise to 
lower precedence for .?

(I would actually like << and >> to be higher than . as well)

Cheers,
Claes


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About