Perl / perl5

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

$PERL_VERSION does not print #1246

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

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

Searchable as RT2237$

p5pRT commented 24 years ago

From @sciurius

Created by @sciurius

  perl -MEnglish -e 'print $PERL_VERSION';

prints "??????" :-( It used to print "5.00503" in 5.005_03.

Perl Info ``` Site configuration information for perl v5.5.670: Configured by jv at Wed Mar 1 11:23:49 CET 2000. Summary of my perl5 (revision 5.0 version 5 subversion 670) configuration: Platform: osname=linux, osvers=2.2.14, archname=i386-linux uname='linux phoenix.squirrel.nl 2.2.14 #2 sun jan 30 18:21:05 cet 2000 i686 unknown ' config_args='-des -Darchname=i386-linux -Dd_dosuid -Dprefix=/opt/perl-5.5.670' 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='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) cppflags='-fno-strict-aliasing -I/usr/local/include' ccflags ='-fno-strict-aliasing -I/usr/local/include' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt libc=/lib/libc-2.1.2.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl v5.5.670: /opt/perl-5.5.670/lib/5.5.670/i386-linux /opt/perl-5.5.670/lib/5.5.670 /opt/perl-5.5.670/lib/site_perl/5.5.670/i386-linux /opt/perl-5.5.670/lib/site_perl/5.5.670 /opt/perl-5.5.670/lib/site_perl . Environment for perl v5.5.670: HOME=/home/jv LANG=en_US LANGUAGE (unset) LC_ALL=en_US LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/opt/perl-5.5.latest/bin:.:/home/jv/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin PERL_BADLANG (unset) SHELL=/bin/tcsh ```
p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

At 15​:16 +0100 2000-03-01\, Johan Vromans wrote​:

perl \-MEnglish \-e 'print $PERL\_VERSION';

prints " û" :-( It used to print "5.00503" in 5.005_03.

perldelta.pod says

The English module now sets $PERL_VERSION to $^V (a string value) rather than C\<$]> (a numeric value). (This is a potential incompatibility. Send us a report via perlbug if you are affected by this.)

I guess you've done that. How big a problem is this incompatibility for you? -- Dominic Dunlop

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

On Wed\, 01 Mar 2000\, Dominic Dunlop wrote​:

At 15​:16 +0100 2000-03-01\, Johan Vromans wrote​:

perl \-MEnglish \-e 'print $PERL\_VERSION';

prints " û" :-( It used to print "5.00503" in 5.005_03.

perldelta.pod says

The English module now sets $PERL_VERSION to $^V (a string value) rather than C\<$]> (a numeric value). (This is a potential incompatibility. Send us a report via perlbug if you are affected by this.)

I guess you've done that. How big a problem is this incompatibility for you?

I don't know about Johan\, but I think it's a bug. What about software that just prints it out (which is pretty much what this variable is there for). You'll break every piece of software that uses this variable.

-- \

Details​: FastNet Software Ltd - XML\, Perl\, Databases. Tagline​: High Performance Web Solutions Web Sites​: http​://come.to/fastnet http​://sergeant.org Available for Consultancy\, Contracts and Training.

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

Dominic Dunlop \domo@&#8203;computer\.org wrote

perldelta.pod says

The English module now sets $PERL_VERSION to $^V (a string value) rather than C\<$]> (a numeric value). (This is a potential incompatibility. Send us a report via perlbug if you are affected by this.)

I guess you've done that. How big a problem is this incompatibility for you?

It may be that 'print $PERL_VERSION' now prints something different\, but it should still look like a version number. I wasn't aware that Perl version numbers had been translated into German.

So it's a clear bug\, incompatibility or not.

Mike Guy

p5pRT commented 24 years ago

From @gsar

On Thu\, 02 Mar 2000 00​:07​:26 GMT\, "M.J.T. Guy" wrote​:

Dominic Dunlop \domo@&#8203;computer\.org wrote

perldelta.pod says

The English module now sets $PERL_VERSION to $^V (a string value) rather than C\<$]> (a numeric value). (This is a potential incompatibility. Send us a report via perlbug if you are affected by this.)

I guess you've done that. How big a problem is this incompatibility for you ?

It may be that 'print $PERL_VERSION' now prints something different\, but it should still look like a version number. I wasn't aware that Perl version numbers had been translated into German.

So it's a clear bug\, incompatibility or not.

It was a conscious choice\, suggested by Larry. I guess we need to think about how big a breakage this is.

Note that it'll still *compare* correctly when you use numeric comparisons\, so it is mostly only a cosmetic/display issue.

We can change it back if you come up with as compelling a name as $PERL_VERSION for it. :-)

Sarathy gsar@​ActiveState.com

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

On Wed\, 1 Mar 2000\, Johan Vromans wrote​:

perl \-MEnglish \-e 'print $PERL\_VERSION';

prints "ʞ" :-( It used to print "5.00503" in 5.005_03.

I'm sure you know that   perl -MEnglish -e 'printf "%vd\n"\, $PERL_VERSION'; print "5.5.670"

is there a way to tag strings that we want printed using a "%vd" format with some magic that would make this work again?

  Maybe if they were some sort of object???

  what about cmp\, and assignments???

  If there is a way\, users would invent reasons to want   to specify the format and the value for the "*"'ed value   that sprintf uses\, .... oh well...

p5pRT commented 24 years ago

From @sciurius

On Wed\, Mar 01\, 2000 at 04​:55​:56PM -0800\, Gurusamy Sarathy wrote​:

Note that it'll still *compare* correctly when you use numeric comparisons\, so it is mostly only a cosmetic/display issue.

I think it is becoming very confusing. $] is a number\, and should be compared numerically\, e.g.

  print "Yes\n" if $] > 5.005_03;

$^V is a string\, and should be compared as a string with a string\, e.g.

  print "Yes\n" if $^V gt 5.5.3;

This works​:

  print "Yes\n" if $^V > 5.005_03;

But this gives a warning​:

  print "Yes\n" if $^V > 5.5.30;

And this fails without warning​:

  print "Yes\n" if $^V gt 5.005_03;

We can change it back if you come up with as compelling a name as $PERL_VERSION for it. :-)

May I suggest $PERLVERSION\, and to remove its dual nature and other magic?

-- Johan

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

Gurusamy Sarathy wrote​:

On Thu\, 02 Mar 2000 00​:07​:26 GMT\, "M.J.T. Guy" wrote​:

It may be that 'print $PERL_VERSION' now prints something different\, but it should still look like a version number. I wasn't aware that Perl version numbers had been translated into German.

So it's a clear bug\, incompatibility or not.

It was a conscious choice\, suggested by Larry. I guess we need to think about how big a breakage this is.

Note that it'll still *compare* correctly when you use numeric comparisons\, so it is mostly only a cosmetic/display issue.

We can change it back if you come up with as compelling a name as $PERL_VERSION for it. :-)

How about $PERL_VERSION_STRING\, assuming that $PERL_VERSION gets aliased back to $] ?

--   Peter Haworth pmh@​edison.ioppublishing.com "I was claiming to be Satan\, and explaining some of my actions. This should give you a slight clue that I may not be presenting a researched thesis."   -- Paul David Jones

p5pRT commented 24 years ago

From @gsar

Note to Larry​: This is about $PERL_VERSION becoming $^V instead of $].

On Thu\, 02 Mar 2000 10​:59​:19 +0100\, Johan Vromans wrote​:

On Wed\, Mar 01\, 2000 at 04​:55​:56PM -0800\, Gurusamy Sarathy wrote​:

Note that it'll still *compare* correctly when you use numeric comparisons\, so it is mostly only a cosmetic/display issue.

I think it is becoming very confusing.

You probably only think so because you're not ignoring the fact that $^V has a numeric value (as you should :) for compatibility.

$] is a number\, and should be compared numerically\, e.g.

print "Yes\n" if $] > 5.005_03;

As it has always been.

$^V is a string\, and should be compared as a string with a string\, e.g.

print "Yes\n" if $^V gt 5.5.3;

As documented.

This works​:

print "Yes\n" if $^V > 5.005_03;

Because $^V is now $PERL_VERSION\, and this provides compatibility and a certain amount of DWIMness.

But this gives a warning​:

print "Yes\n" if $^V > 5.5.30;

Of course\, because you're not expected to do that (see perlvar.pod).

And this fails without warning​:

print "Yes\n" if $^V gt 5.005_03;

Ditto\, and I'm not sure what to do about. It is the same class of problem as the user doing​:

  $anyoldstring gt 1.234_567

We can change it back if you come up with as compelling a name as $PERL_VERSION for it. :-)

May I suggest $PERLVERSION\, and to remove its dual nature and other magic?

Aside from the dual value\, there is no other magic. And I don't think you've shown that the dual value actually hurts.

I guess we can make it $PERL_VERSION_STRING again and let sleeping dogs lie\, but I'm going to let Larry rule on it\, because he may have written $PERL_VERSION as being $^V in camel3-2b around the time he suggested doing that.

Sarathy gsar@​ActiveState.com

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

Johan Vromans writes​:

May I suggest $PERLVERSION\, and to remove its dual nature and other magic?

And I would suggest removing v12.34 altogether.

[I do not object to qv(12.34) or qq(\v12.34).]

Ilya

p5pRT commented 24 years ago

From @TimToady

Gurusamy Sarathy writes​: : I guess we can make it $PERL_VERSION_STRING again and let sleeping dogs lie\, : but I'm going to let Larry rule on it...

I'd like to leave $^V as $PERL_VERSION. Putting a square peg into a round hole can be worthwhile if you don't mind a few shavings.

Larry