home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!panther!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
- From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
- Subject: scripts should indicate the Perl version (a proposal)
- Message-ID: <mcook.721326723@fendahl.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: fendahl.dev.cdx.mot.com
- Organization: Motorola Codex, Canton, Massachusetts
- Date: Mon, 9 Nov 1992 16:32:03 GMT
- Lines: 21
-
- How about this idea: There should be a way to specify in a Perl script what
- version of Perl the script was written for. Then, as new keywords and other
- non-backwardly-compatible functionality are added, old scripts could still
- likely work correctly. For example, these two scripts might behave
- differently:
-
- #! /usr/local/bin/perl
- version 2.0;
- print "1" | "2";
-
- #! /usr/local/bin/perl
- version 4.0;
- print "1" | "2";
-
- because the | operator's meaning changed between Perl versions 2.0 and 4.0 (or
- whenever). With the first script, perl would see the "version 2.0" statement,
- and disable that new meaning associated with the | operator.
-
- Make sense?
-
- Michael.
-