http://www.perlmonks.org?node_id=1003054


in reply to list assignment to list in scalar context

List assignment in a scalar context returns the number of items in the right-hand side because that is extremely useful as a Boolean test, as shown in your own example:

while( my( $k, $v ) = each %h ) {

You wouldn't want that loop to terminate early just because one of the values in %h was false.

- tye