So the "last" ends the foreach loop since a subroutine returns by default the result of the last operation right?No. If you use next or last to exit a subroutine, the subroutine doesn't return a value; the next code to execute will a new iteration of the loop or the code after the loop, not the code receiving whatever the sub would have returned if it had returned.
In reply to Re^3: next'ing out of a "foreach" loop within a subroutine
by ysth
in thread next'ing out of a "foreach" loop within a subroutine
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |