Skip to content

Commit a61c9d8

Browse files
committed
perlsyn/switch: no longer experimental but discouraged
1 parent 2135308 commit a61c9d8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pod/perlsyn.pod

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,20 +863,23 @@ C<defer>.
863863

864864
X<switch> X<case> X<given> X<when> X<default>
865865

866+
The C<switch> feature is discouraged for new code and is retained for
867+
backward compatibility.
868+
866869
Starting from Perl 5.10.1 (well, 5.10.0, but it didn't work
867870
right), you can say
868871

869872
use feature "switch";
870873

871-
to enable an experimental switch feature. This is loosely based on an
874+
to enable the switch feature. This is loosely based on an
872875
old version of a Raku proposal, but it no longer resembles the Raku
873876
construct. You also get the switch feature whenever you declare that your
874877
code prefers to run under a version of Perl between 5.10 and 5.34. For
875878
example:
876879

877880
use v5.14;
878881

879-
Under the "switch" feature, Perl gains the experimental keywords
882+
Under the "switch" feature, Perl gains the keywords
880883
C<given>, C<when>, C<default>, C<continue>, and C<break>.
881884
Starting from Perl 5.16, one can prefix the switch
882885
keywords with C<CORE::> to access the feature without a C<use feature>
@@ -893,8 +896,8 @@ in the previous section could be rewritten as
893896
default { $nothing = 1 }
894897
}
895898

896-
The C<foreach> is the non-experimental way to set a topicalizer.
897-
If you wish to use the highly experimental C<given>, that could be
899+
The C<foreach> is another way to set a topicalizer.
900+
If you wish to use C<given>, that could be
898901
written like this:
899902

900903
use v5.10.1;

0 commit comments

Comments
 (0)