Perl language structure: Difference between revisions

Content deleted Content added
External links: This is not about Perl itself, but details of the language. Removed categories so it doesn't show up in places it shouldn't.
Line 279:
Syntactically, this structure behaves similarly to [[switch statement]]s found in other languages, but with a few important differences. The largest is that unlike switch/case structures, given/when statements break execution after the first successful branch, rather than waiting for explicitly defined break commands. Conversely, explicit <code>continue</code>s are instead necessary to emulate switch behavior.
 
For those not using Perl 5.10, the Perl documentation describes a half-dozen ways to achieve the same effect by using other control structures. There is also a Switch module, which provides functionality modeled on thethat forthcomingof sister language [[PerlRaku 6(programming language)|Raku]] re-design. It is implemented using a [[source filter]], so its use is unofficially discouraged.<ref>[http://www.perlmonks.org/?node_id=496084 using switch<!-- Bot generated title -->]</ref>
 
Perl includes a <code>goto label</code> statement, but it is rarely used. Situations where a <code>goto</code> is called for in other languages don't occur as often in Perl, because of its breadth of flow control options.