Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat parts of given/when are experimental?
    text
    copied!<p>Has the entire "switch" feature become experimental? Are there parts of it I can rely on using without future versions of Perl breaking my code? In general, what is the policy toward changing stable features to experimental?</p> <h2>Background</h2> <p><code>use feature "switch"</code> has been in Perl since 5.10. From 5.10 to 5.14, <code>perlsyn</code> seems to indicate that this is a stable, supported feature.</p> <p>Starting with 5.16, however, <code>perlsyn</code> <a href="http://perldoc.perl.org/5.16.2/perlsyn.html#Switch-Statements" rel="noreferrer">begins to call it</a> "an <em>experimental</em> switch feature" and gets a lot more confusing about what's considered experimental.</p> <p>Parts of the documentation seem to indicate <em>everything</em> about the feature is experimental:</p> <blockquote> <p>Under the "switch" feature, Perl gains the experimental keywords <code>given</code>, <code>when</code>, <code>default</code>, <code>continue</code>, and <code>break</code>.</p> </blockquote> <p>There's even an entire section about the <a href="http://perldoc.perl.org/perlsyn.html#Experimental-Details-on-given-and-when" rel="noreferrer">Experimental Details on given and when</a>.</p> <p>However, <code>perlsyn</code> <em>also</em> says that "The <code>foreach</code> is the non-experimental way to set a topicalizer" and gives an example that seems to imply that foreach/when is not experimental.</p> <p>As far as I can tell, the "experimental" language came from <a href="https://github.com/mirrors/perl/commit/c2f1e229171d1aa65dacd9b3bb09f4298de8fba7" rel="noreferrer">commit c2f1e22</a> which references <a href="https://rt.perl.org/rt3/Public/Bug/Display.html?id=90926" rel="noreferrer">RT #90926</a> which still doesn't give much context, even when paired with <a href="https://rt.perl.org/rt3/Public/Bug/Display.html?id=90906" rel="noreferrer">RT# 90906</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload