develooper Front page | perl.perl5.porters | Postings from July 2019

[perl #134273] perlvar - recommend numeric comparisons for $]

Thread Previous
From:
Dan Book
Date:
July 9, 2019 05:40
Subject:
[perl #134273] perlvar - recommend numeric comparisons for $]
Message ID:
rt-4.0.24-10073-1562650819-1206.134273-75-0@perl.org
# New Ticket Created by  Dan Book 
# Please include the string:  [perl #134273]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=134273 >


The $] variable is a numeric version and so numeric comparisons should be
used to avoid weirdness due to trailing zeroes; these comparisons work fine
in most cases, stringifying $] before the comparison fixes issues on old
Perls where its numeric value is calculated differently. The attached patch
will update the documentation for $] to recommend this.

-Dan


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About