home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / perl / 6909 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.1 KB  |  33 lines

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