I, also, am a bit unsure of the real question of rthawkcom.
However, if it has to do with the fact that the @out array has all the values of the %hash when $_; is the last statement executed in the map block and has a few empty strings in place of hash values when $_; is not the last statement, I think I can explain.
The value of the map block on each iteration will be the value of the last expression evaluated in the block. This is always the $_ expression, previously set to a hash value, when the $_; statement is last.
When the
if($_>$max){$max=$_}
statement is last, $_>$max will be the last expression evaluated when $_ is less than or equal to $max (and it will evaluate to the empty string, or false).
When $_ is greater than $max the $max=$_ true clause of the statement will execute, which evaluates to $_ previously set to a hash value.
Update: This reply is essentially the same as jethro's.
In reply to Re: Map Function Weirdness
by AnomalousMonk
in thread Map Function Weirdness
by rthawkcom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |