Skip to content

[doc] 'switch' feature still documented as removed in 5.42 #23282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mauke opened this issue May 13, 2025 · 1 comment · May be fixed by #23288
Open

[doc] 'switch' feature still documented as removed in 5.42 #23282

mauke opened this issue May 13, 2025 · 1 comment · May be fixed by #23288

Comments

@mauke
Copy link
Contributor

mauke commented May 13, 2025

Where
feature.pm

Description
perldoc feature says about the switch feature:

It will be removed in Perl 5.42.

But that can't be true because ./perl -Ilib -e 'use feature "switch";' still runs fine (and we're about to release 5.42).

@jkeenan
Copy link
Contributor

jkeenan commented May 14, 2025

lib/feature.pm is a generated file. We'll need to take a look at this documentation found starting at around line 711 of regen/feature.pl.:

=head2 The 'smartmatch' feature

C<use feature 'smartmatch'> tells the compiler to enable the
smartmatch operator C<~~>.  It is enabled by default, but can be
turned off to disallow the C<~~> operator.

This feature is disabled by default in the 5.42 feature bundle
onwards:

  $x ~~ $y; # fine
  use v5.42;
  $x ~~ $y; # error

This has no effect on the implicit smartmatches done by C<when>.

See L<perlop/"Smartmatch Operator"> for details.

=head2 The 'switch' feature

B<WARNING>: This feature is still experimental and the implementation may
change or be removed in future versions of Perl.  For this reason, Perl will
warn when you use the feature, unless you have explicitly disabled the warning:

    no warnings "experimental::smartmatch";

C<use feature 'switch'> tells the compiler to enable the Raku
given/when construct.

See L<perlsyn/"Switch Statements"> for details.

This feature is available starting with Perl 5.10.
It is deprecated starting with Perl 5.38, and using
C<given>, C<when> or smartmatch will throw a warning.
It will be removed in Perl 5.42.

Suggestions?

tonycoz added a commit to tonycoz/perl5 that referenced this issue May 15, 2025
It no longer produces experimental warnings.

Fixes Perl#23282
@tonycoz tonycoz linked a pull request May 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants