The most useful application of this semantic is in a construct like
while (my ($key, $value) = each %hash)
or
if (my ($x, $y) = /(...)(...)/)
If anything is assigned to the list of variables, the result of the assignment
will be at least 1 (or more likely 2, in the cases
The following is from page 75 in the Camel:
List assignment in scalar context returns the number of elements produced by
the expression on the iright/i side of the assignment:
$x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2
why. how.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Nkuipers wrote:
The following is from page 75 in the Camel:
List assignment in scalar context returns the number of elements produced
by the expression on the iright/i side of the assignment:
$x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2
can you guess what $x is now:
$x = ($a,$b)
On Wed, Oct 09, 2002 at 03:22:20PM -0700, nkuipers wrote:
The following is from page 75 in the Camel:
List assignment in scalar context returns the number of elements produced by
the expression on the iright/i side of the assignment:
$x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2