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 above).  That value is
true and hence the condition succeeds.

This is a case of where the syntax looks quite intuitive and yet it works by
virtue of a language feature virtually no one knows.

-- 
Peter Scott
http://www.perldebugged.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to