home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!caen!sol.ctr.columbia.edu!eff!ckd
- From: ckd@eff.org (Christopher Davis)
- Subject: Re: scripts should indicate the Perl version (a proposal)
- In-Reply-To: mcook@fendahl.dev.cdx.mot.com's message of Mon, 9 Nov 1992 16:32:03 GMT
- Message-ID: <CKD.92Nov9194435@loiosh.eff.org>
- Sender: usenet@eff.org (NNTP News Poster)
- Nntp-Posting-Host: loiosh.eff.org
- Organization: Electronic Frontier Foundation Tech Central
- References: <mcook.721326723@fendahl.dev.cdx.mot.com>
- Date: Tue, 10 Nov 1992 00:44:37 GMT
- Lines: 34
-
- MC> == Michael Cook <mcook@fendahl.dev.cdx.mot.com>
-
- MC> How about this idea: There should be a way to specify in a Perl
- MC> script what version of Perl the script was written for. Then, as
- MC> new keywords and other non-backwardly-compatible functionality are
- MC> added, old scripts could still likely work correctly.
-
- How about assigning to $]? That would handle both forward and backward
- compatibility issues:
-
- #!/usr/bin/perl -- #-*-Perl-*-
-
- # this script requires 4.0.35
- # and might break under 5.0 because it does undocumented bizarrities
- # so we'll force it to be compatible
-
- $] = "4.0.35";
-
- This would have an advantage over the traditional behavior of merely
- checking $] for the correct version: it would automatically be
- compatible. Older versions (say, 3.0.18) would go out and ftp the
- newest package, compile it, and install it. Newer versions (5.0) could
- lobotomize themselves as you suggested. Everyone would be happy.
-
- print "Just another ",$sarcastic,"perl hacker,";
-
- (The real solution would be not to use lower case unquoted strings, and
- trust in Larry not to break anything. Or hard-code the version, say:
- #!/usr/local/bin/perl4.035 -- #-*-Perl-*-)
- --
- Christopher K. Davis | ``Usenet seems to run much like the Kif (or,
- <ckd@eff.org> EFF #14 | for the TV generation, Klingon) high command.
- System Administrator, EFF | Whoever takes action and can be heard wins.''
- +1 617 864 0665 [CKD1] | --Peter da Silva <peter@ferranti.com>
-