Here's another "What's a quick and real neat way of...." type question
Shaun McCarthy
shaunm at web.co.nz
Thu Nov 14 16:28:40 CST 2002
yup :) Or ()'s around the assignment...
Shaun
-----Original Message-----
From: Grant McLean
Sent: Fri 15/11/2002 9:25 a.m.
To: Shaun McCarthy
Cc: wellington-pm-list at pm.org
Subject: RE: Here's another "What's a quick and real neat way of...." type question
> -----Original Message-----
Shaun McCarthy wrote:
> while (@a && my($a, $b) = (shift @a, shift @b)) {
> }
Actually, you need to use either the lower priority 'and':
while (@a and my($a, $b) = (shift @a, shift @b)) {
}
or use parentheses to stop the && binding to the my($a, $b)
and causing the remainder of the line to be a syntax error
("assignment to a logical &&").
Grant
===============================================================
Grant McLean BearingPoint Inc - formerly The Web Limited
+64 4 495 9026 Level 6, 20 Customhouse Quay, Box 1195
gmclean at bearingpoint.biz Wellington, New Zealand
More information about the Wellington-pm
mailing list