develooper Front page | perl.perl5.porters | Postings from December 2014

Re: *-couragement of $^V

Thread Previous | Thread Next
David Golden
December 11, 2014 17:30
Re: *-couragement of $^V
Message ID:
On Thu, Dec 11, 2014 at 12:11 PM, Ricardo Signes <>

> Can you tell me when/how it's more DWIMmy?  I

Post 5.10:

(1) stringifies nicer than $]
(2) overloaded comparision

For #2, it makes "eq" and "==" equivalent, and ensures proper tuple
comparison.  I recall that inadvertent floating point comparison for
equality caused problems due to 64 bit float precision.  (That may have
been fixed in some perl version.)

It's lets people express version comparison with either v-strings or
strings or decimals:

    $^V == v5.10.1 or $^V == "v5.10.1" or $^V == 5.010001

That's handy if the right operand came from some variable somewhere (e.g.
from a text file) -- you don't need to care what format it's in.  You don't
have to inspect, or convert, or pick the right type of comparison operator.


David Golden <> Twitter/IRC: @xdg

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About