-
Notifications
You must be signed in to change notification settings - Fork 577
Encourage use of $] over $^V #14317
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
Comments
From @jkeenanIn a perl5-porters list discussion beginning here: http://markmail.org/search/?q=perl5-porters#query:perl5-porters%20order%3Adate-backward+page:2+mid:yzcyfzizqig6vmoy+state:results Ricardo Signes wrote: ##### I suggest that given the general confusion around v-strings and version objects, as well as the fact that Please find attached a documentation patch which implements this approach. -- |
From @jkeenan0001-Encourage-use-of-over-V.patchFrom 342bbf6e755801a521528c1bca0aee210ddede5e Mon Sep 17 00:00:00 2001
From: James E Keenan <[email protected]>
Date: Mon, 8 Dec 2014 20:28:59 -0500
Subject: [PATCH] Encourage use of $] over $^V.
---
pod/perlvar.pod | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 8561eb8..bcf24af 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -676,7 +676,9 @@ C<"%vd"> conversion:
See the documentation of C<use VERSION> and C<require VERSION>
for a convenient way to fail if the running Perl interpreter is too old.
-See also C<$]> for an older representation of the Perl version.
+C<$]> is an older representation of the Perl version which is preferable to
+C<$^V> in many situations because its meaning has not changed from one Perl
+version to another.
This variable was added in Perl v5.6.0.
@@ -2273,9 +2275,6 @@ Deprecated in Perl v5.12.0.
=item $]
X<$]>
-See L</$^V> for a more modern representation of the Perl version that allows
-accurate string comparisons.
-
The version + patchlevel / 1000 of the Perl interpreter. This variable
can be used to determine whether the Perl interpreter executing a
script is in the right range of versions:
@@ -2290,6 +2289,9 @@ for a convenient way to fail if the running Perl interpreter is too old.
Mnemonic: Is this version of perl in the right bracket?
+See L</$^V> for a more recent -- but not necessarily better -- representation
+of the Perl version that allows accurate string comparisons.
+
=back
=cut
--
1.9.1
|
From @jkeenanSummary of my perl5 (revision 5 version 21 subversion 5) configuration: Characteristics of this binary (from libperl): |
From @cpansproutOn Mon Dec 08 17:35:36 2014, jkeenan wrote:
I like your patch. -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @ap* James E Keenan <perlbug-followup@perl.org> [2014-12-09 02:40]:
I think this is the right general idea with not just telling people to “Preferable in many cases” – which cases? “Not necessarily better” – So it essentially says “$^V is newer but we won’t endorse it for unclear Helpful would be for the docs to provide clear guidance. They ought to So let’s start with $] – what problems are there or have there been with Regards, |
From @AbigailOn Tue, Dec 09, 2014 at 03:27:14AM -0800, Aristotle Pagaltzis via RT wrote:
I'm all for documentation that doesn't voice opinions. It should give Abigail |
From @TuxOn Tue, 9 Dec 2014 17:54:06 +0100, Abigail <abigail@abigail.be> wrote: I have no idea why this went off-list ...
Wholeheartedly agree
-- |
From @jkeenanOn Tue Dec 09 09:10:01 2014, hmbrand wrote:
Alright, since you all didn't like my patch, could someone else produce one? Thank you very much. |
From @ap* James E Keenan via RT <perlbug-followup@perl.org> [2014-12-10 01:10]:
Yes, once there are answers to these questions: * Aristotle Pagaltzis <pagaltzis@gmx.de> [2014-12-09 12:30]:
I don’t have them, which is why I haven’t offered a patch so far. |
From @LeontOn Tue, Dec 9, 2014 at 12:26 PM, Aristotle Pagaltzis <pagaltzis@gmx.de>
$] has a numeric notation that doesn't match the semantic version notation $^V has the issue of radically changing its behavior in 5.10. Its Leon |
From @khwilliamsonOn 12/10/2014 08:30 AM, Leon Timmermans wrote:
Something like: If you need to distinguish between versions that are lt 5.6.0, you have |
From @cpansproutOn Wed Dec 10 16:38:31 2014, public@khwilliamson.com wrote:
But with $], of course. :-) (Is this version of Perl in the right bracket?) -- Father Chrysostomos |
From @khwilliamsonI'm closing this ticket, as different text was eventually applied which makes this overtaken-by-events. I'll add a sentence to perlvar that emphasizes that the behaviour of $] hasn't changed since its inception Karl Williamson |
@khwilliamson - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#123392 (status was 'resolved')
Searchable as RT123392$
The text was updated successfully, but these errors were encountered: