Closed p5pRT closed 20 years ago
when I start a script with
require 5.6;
and run it under Perl 5.6.0
I get
Perl v5.600.0 required--this is only v5.6.0\,
I guess\, technically\, 5.600.0 != 5.6.0 but they are morally equivalent and besides\, I didn't actually specify my require to that many decimal places of accuracy...
When I run the same script under Perl 5.00503 (or 5.00404) I get what I expect\, e.g.
Perl 5.6 required--this is only version 5.00503
Sorry as I am to admit it\, we are predominately running Perl 5.00404 where I am working. But we do have access to 5.6 for _new_ code.
If I change the require to run happily under Perl 5.6\, as
require 5.6.0;
Then it works as expected _under Perl 5.6_. However\, under Perl 5.00503 or 5.00404 I now get
Can't locate 5.60 in @INC
which\, while it does stop the script from running\, isn't quite in keeping with the spirit of "require Version";
As a bug\, I suggest that Perl 5.6 should treat
require 5.6;
as meaning what it says it means and matching 5.6.0. Not 5.6.1 maybe\, but certainly 5.6.0. (Actually\, since require Version is the "lowest allowable version" 5.6.0 _should_ match 5.6.1).
====
In related matters\, if anyone reading this can suggest a portable require that I can use to ensure that I _can_ require 5.6 or later AND at the same time ensure that the resulting error message is reasonable under 5.005 or 5.004\, please let me know. At present\, to succeed under 5.6 I must fail ungracefully under earlier versions of Perl.
On Fri\, Feb 16\, 2001 at 01:29:32PM -0800\, vicki.brown@barclaysglobal.com wrote:
when I start a script with
require 5.6;
and run it under Perl 5.6.0
I get
Perl v5.600.0 required--this is only v5.6.0\,
Perl version v5.6.0 is equivalent to version 5.006_00. This makes sense\, since v5.6 is encoded as "\x05\x06". Version 5.6 (note no v) is equivalent to 5.600\, which is equivalent to v5.600.
In related matters\, if anyone reading this can suggest a portable require that I can use to ensure that I _can_ require 5.6 or later AND at the same time ensure that the resulting error message is reasonable under 5.005 or 5.004\, please let me know. At present\, to succeed under 5.6 I must fail ungracefully under earlier versions of Perl.
See response to earlier bug report.
require 5.006;
Ronald
Ronald J Kimball \rjk@​linguist\.Thayer\.dartmouth\.edu writes:
Perl version v5.6.0 is equivalent to version 5.006_00. This makes sense\, since v5.6 is encoded as "\x05\x06". Version 5.6 (note no v) is equivalent to 5.600\, which is equivalent to v5.600.
Thanks for the explanation. The question remains whether this obeys the principle of least surprise. The Camel and other books talk about Perl 5.6\, so it makes sense to put a "require 5.6" in one's program.
IMHO\, "require" could make a distinction between "5.6" and "5.600"\, and then DWIM.
-- Johan
On Sat\, Feb 17\, 2001 at 10:42:28AM +0100\, Johan Vromans wrote:
Ronald J Kimball \rjk@​linguist\.Thayer\.dartmouth\.edu writes:
Perl version v5.6.0 is equivalent to version 5.006_00. This makes sense\, since v5.6 is encoded as "\x05\x06". Version 5.6 (note no v) is equivalent to 5.600\, which is equivalent to v5.600.
Thanks for the explanation. The question remains whether this obeys the principle of least surprise. The Camel and other books talk about Perl 5.6\, so it makes sense to put a "require 5.6" in one's program.
5.6 is a floating point number\, not a version string. In Perl\, the v is not optional for a version string that contains a single period. (Of course\, it was debated whether the v should have been optional for multiple-period version strings.) Apparently\, in a book\, the v is optional in all cases.
IMHO\, "require" could make a distinction between "5.6" and "5.600"\, and then DWIM.
If we do that\, then I think we could never go higher than 9 for patchlevel.
And\, if we make that allowance for require\, would we have to do it everywhere someone might use 5.6 when they really mean v5.6? Fun...
Ronald
Migrated from rt.perl.org#5838 (status was 'resolved')
Searchable as RT5838$