home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / perl / 6950 < prev    next >
Encoding:
Text File  |  1992-11-11  |  879 b   |  30 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: explicit sub parameters - a proposal
  5. Message-ID: <mcook.721530385@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: Thu, 12 Nov 1992 01:06:25 GMT
  10. Lines: 18
  11.  
  12. What about this idea: perl should allow this construct:
  13.  
  14.     sub foo($a, $b, @rest) {
  15.       # ...
  16.     }
  17.  
  18. which would be exactly equivalent to
  19.  
  20.     sub foo {
  21.       local ($a, $b, @rest) = @_;
  22.       # ...
  23.     }
  24.  
  25. That would greatly improve the readability of Perl, I think.  (Not to mention
  26. the fact that people might be less likely to stumble into all the strange
  27. things that can happen when you start playing around with @_.)
  28.  
  29. Michael.
  30.