In both forms, the value returned is the value of the last expression evaluated inside the mini-program; a return statement may be also used, just as with subroutines.
Would you think this was weird behavior if your code looked like?:
for (foo()) { # ... } sub foo { return @{ $aref }; }
Cheers - L~R
In reply to Re: Reassigning $_ in loop doesn't stick
by Limbic~Region
in thread Reassigning $_ in loop doesn't stick
by bennymack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |