P is for Practical | |
PerlMonks |
Re: map and returnby merlyn (Sage) |
on Sep 03, 2009 at 10:14 UTC ( [id://793145]=note: print w/replies, xml ) | Need Help?? |
The behavior is consistent, even though the syntax is misleading. In both cases, precisely one level of subroutine call is being popped.
A similar situation exists when you compare a do { ... } while (...) loop with a while (...) { ... } loop: last/next/redo ignore the former (and act on an outer block), while they respect the latter as the innermost enclosing loop block. Confusing to a beginner, but makes sense once you play with it for a bit. -- Randal L. Schwartz, Perl hacker The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
In Section
Seekers of Perl Wisdom
|
|