Mailing List Archive

No string sense for $] anymore?
Has no one else notice that the string sense of $] went away?
I'm not sure I want it back, but we never used to HAVE a string
sense. An ancient-beyond-belief script of mine broke:

$] =~ /(\d+\.\d+).*\nPatch level: (\d+)/;
die "$iam: requires at least perl version 3.0, patchlevel 1 to run correctly\n"
if $1 < 3.0 || ($1 == 3.0 && $2 < 1);

--tom

Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com

Ken is very smart but also very opinionated. --Doug Gwyn
Re: No string sense for $] anymore? [ In reply to ]
Strange sunspot activity caused Tom Christiansen <tchrist@mox.perl.com> to writ
e:
| Has no one else notice that the string sense of $] went away?

Nope, not until you mentioned it actually.

| I'm not sure I want it back, but we never used to HAVE a string
| sense. An ancient-beyond-belief script of mine broke:

Other than you, does/has anyone ever even used this? I don't think I ever
had a call for it before 5.000 anyway (may come from starting perl after
4.036 was released ;-), and I just always use "require 5.00X" now.

You know, it's not often I respond to signatures, but Tom's just gotten two
good ones in a row this evening. ;-)

| Ken is very smart but also very opinionated. --Doug Gwyn

"Personally, I don't care whether someone is cool enough to quote Doug
Gwyn--I only care whether Doug Gwyn is cool enough to quote."
-Larry Wall (lwall@netlabs.com)
Re: No string sense for $] anymore? [ In reply to ]
I noticed this also when I put "$]" in a couple Perl4 vs. Perl5 bug demo
scripts.

The manual in 5.001m (perlvar.pod) still claims it returns the string
printed by "perl -v". If it's not restored, the manual should be changed.

There's something to be said for maintaining backward compatibility in
cases where there's no compelling reason to do otherwise. I think that the
string version '$]' was added in Perl3, but the numeric version wasn't
added until somewhere in the middle of Perl4, so there are probably a
number of Perl3/Perl4 scripts that are still trying to parse the old "$]".
In general, Perl has been pretty good as far as maintaining backward
compatibility is concerned. I'm still running some of my old Perl1 scripts
that I've never had to change!

pete peterson
rep@genrad.com
(508)287-7478; Home: (508)256-5829 (Chelmsford, MA)

--------------------
To: perlbug@mox.perl.com
Subject: No string sense for $] anymore?
Date: Sun, 08 Oct 95 21:15:06 MDT
From: Tom Christiansen <tchrist@mox.perl.com>

Has no one else notice that the string sense of $] went away?
I'm not sure I want it back, but we never used to HAVE a string
sense. An ancient-beyond-belief script of mine broke:

$] =~ /(\d+\.\d+).*\nPatch level: (\d+)/;
die "$iam: requires at least perl version 3.0, patchlevel 1 to run correctly\n"
if $1 < 3.0 || ($1 == 3.0 && $2 < 1);
Re: No string sense for $] anymore? [ In reply to ]
It went away because Perl is no longer under RCS, and because people were
continually confusing the patchlevel with the branch number in perl.c.

: There's something to be said for maintaining backward compatibility in
: cases where there's no compelling reason to do otherwise.

It seemed like a compelling reason at the time. :-)

Larry
Re: No string sense for $] anymore? [ In reply to ]
Strange perlspot avtivity lead Stephen Potter to write :
|| Strange sunspot activity caused Tom Christiansen <tchrist@mox.perl.com> to writ
|| e:
|| | Has no one else notice that the string sense of $] went away?
||
|| Nope, not until you mentioned it actually.
||
|| | I'm not sure I want it back, but we never used to HAVE a string
|| | sense. An ancient-beyond-belief script of mine broke:
||
|| Other than you, does/has anyone ever even used this? I don't think I ever
|| had a call for it before 5.000 anyway (may come from starting perl after
|| 4.036 was released ;-), and I just always use "require 5.00X" now.

Yep. From the common library module used by our code:

($perlversion, $perlpatchlevel) =
$] =~ /([0-9]+[0-9]*).*\nPatch level: (\d+)/;

and the particular piece of code that first lead this to be made
available (somewhat trimmed down):

if ($perlversion >= 3) {
$success =
eval "dbmopen(sardb, \"$sardbmfile\", 0666 & ~$expertCreateUmask);";
}

We used this to make use of the "new" dbmopen feature but still
have our code run successfully on less leading edge version 2
systems.

Backward compatibility on this item is not too important to me -
the numeric value has been around long enough that all of our
installed base supports it. (In fact, all of them are at 4.036
- when 5.002 comes out, we'll probably be about ready to
consider migrating. Some day, I might get rid of this
particular bit of version level testing in our code, too - the
condition is always true now.)

--
Maybe we can fix reality one of these days. | John Macdonald
<- Larry Wall Carl Dichter -> | jmm@Elegant.COM
I'd be happy if we could just index it. |