Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.91k stars 542 forks source link

Perl v5.600.0 required--this is only v5.6.0, #3430

Closed p5pRT closed 20 years ago

p5pRT commented 23 years ago

Migrated from rt.perl.org#5838 (status was 'resolved')

Searchable as RT5838$

p5pRT commented 23 years ago

From vicki.brown@barclaysglobal.com

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.

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.6.0: Configured by jacobc at Tue Jun 13 16:36:22 PDT 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.6, archname=sun4-solaris uname='sunos aa-backup1 5.6 generic_105181-15 sun4u sparc sunw,ultra-2 ' config_args='-Dprefix=/usr/local/tools/perl-5.6.0' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-O', gccversion= cppflags='-I/usr/local/include' ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib -L/usr/local/SUNWspro/SC4.2/lib ' libpth=/usr/local/lib /usr/local/SUNWspro/SC4.2/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib -L/usr/local/SUNWspro/SC4.2/lib' Locally applied patches: @INC for perl v5.6.0: /usr/local/tools/perl-5.6.0/lib/5.6.0/sun4-solaris /usr/local/tools/perl-5.6.0/lib/5.6.0 /usr/local/tools/perl-5.6.0/lib/site_perl/5.6.0/sun4-solaris /usr/local/tools/perl-5.6.0/lib/site_perl/5.6.0 /usr/local/tools/perl-5.6.0/lib/site_perl . Environment for perl v5.6.0: HOME=/ext203/home/browvic LANG (unset) LANGUAGE (unset) LC_COLLATE=en_US LC_CTYPE=en_US LC_MESSAGES=C LC_MONETARY=en_US LC_NUMERIC=en_US LC_TIME=en_US LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=~/bin/perlbin:/ext203/home/browvic/bin:/ext203/home/browvic/nib:/usr/local/bin:/usr/ucb:/usr/bin:/bin:/etc:/sbin:/usr/sbin:/usr/games:.:/net/asg-sf03/prod/sybase/bin:/usr/lib/lp/postscript:~/Work/bagelbin:~/Work/Bins PERL_BADLANG (unset) SHELL=/bin/tcsh ```
p5pRT commented 23 years ago

From @tamias

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

p5pRT commented 23 years ago

From @sciurius

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

p5pRT commented 23 years ago

From @tamias

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