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
feature documentation does not include warnings #14167
Comments
From jakob.voss@gbv.deThe documentation of "feature" (http://perldoc.perl.org/feature.html) Flags: -- |
From madcityzen@gmail.com
Here is a patch to regen/feature.pl (and its regenerated lib/feature.pm) that adds an appropriate note about switch and tells how to disable that warning (given warns because smartmatch is experimental). Was I supposed to run regen.pl? OT: I can see the ticket via http://rt.perl.org <http://rt.perl.org/> when I am anonymous, but when I'm logged in I get "You don't have permission". Is that expected?
'switch' is the only feature that is affected by this (experimental but in a feature bundle), so I could add a note down there, but I don't think it needs anything fancy. If it does need something fancy to plan for if this happens again, I've got an idea. Doug Bell |
From madcityzen@gmail.com0001-mention-switch-is-experimental-in-feature.pm.patchFrom d9ffdd271cc0b1bd091387a6e90c70613ce8b638 Mon Sep 17 00:00:00 2001
From: Doug Bell <madcityzen@gmail.com>
Date: Fri, 17 Oct 2014 21:33:27 -0500
Subject: [PATCH] mention 'switch' is experimental in feature.pm
The other experimental features already have nice warnings in feature.pm
---
lib/feature.pm | 6 ++++++
regen/feature.pl | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/lib/feature.pm b/lib/feature.pm
index 3f93f23..fe78881 100644
--- a/lib/feature.pm
+++ b/lib/feature.pm
@@ -135,6 +135,12 @@ This feature is available starting with Perl 5.10.
=head2 The 'switch' feature
+B<WARNING>: Because the L<smartmatch operator|perlop/"Smartmatch Operator"> is
+experimental, Perl will warn when you use this feature, unless you have
+explicitly disabled the warning:
+
+ no warnings "experimental::smartmatch";
+
C<use feature 'switch'> tells the compiler to enable the Perl 6
given/when construct.
diff --git a/regen/feature.pl b/regen/feature.pl
index 1ffca38..b58381c 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -450,6 +450,12 @@ This feature is available starting with Perl 5.10.
=head2 The 'switch' feature
+B<WARNING>: Because the L<smartmatch operator|perlop/"Smartmatch Operator"> is
+experimental, Perl will warn when you use this feature, unless you have
+explicitly disabled the warning:
+
+ no warnings "experimental::smartmatch";
+
C<use feature 'switch'> tells the compiler to enable the Perl 6
given/when construct.
--
2.0.0
|
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Fri Oct 17 19:52:56 2014, madcityzen@gmail.com wrote:
Thank you. Applied as 7caca87.
By patching feature.pm as well, you have effectively done that.
I’m not seeing that here: <https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122998>
I have no opinion on this. But I guess this means the ticket should stay open a bit. -- Father Chrysostomos |
Migrated from rt.perl.org#122998 (status was 'open')
Searchable as RT122998$
The text was updated successfully, but these errors were encountered: