in reply to Exiting subroutine via next
I'm not sure, but pg's comment in the referenced thread talks about how semantically a sub is a block in the scope of where it was called (with differences of course, such as not seeing lexicals of the containing scope). Since next just looks up the scope change for the nearest encasing block, which in this case is the foreach.
I don't really know how to explain the quoted documentation though. I just edited your function to include a return statement, and it still worked the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exiting subroutine via next
by ikegami (Patriarch) on Dec 07, 2006 at 06:38 UTC | |
by geekphilosopher (Friar) on Dec 07, 2006 at 21:32 UTC | |
|
Re^2: Exiting subroutine via next
by ysth (Canon) on Dec 07, 2006 at 06:32 UTC |