Here's another "What's a quick and real neat way of...." type question

Grant McLean Grantm at web.co.nz
Thu Nov 14 16:25:03 CST 2002


> -----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