home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5587 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.3 KB

  1. Path: sparky!uunet!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: 4.035 bug or feature...why does this run?
  5. Message-ID: <1992Aug28.185620.9841@netlabs.com>
  6. Date: 28 Aug 92 18:56:20 GMT
  7. References: <1992Aug27.171036.28995@odin.corp.sgi.com> <BtnMC5.51s@news.cso.uiuc.edu>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 27
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <BtnMC5.51s@news.cso.uiuc.edu> ejk@ux2.cso.uiuc.edu (Ed Kubaitis - CCSO) writes:
  14. : -->Subject: relaxed requirement for semicolon at the end of a block
  15.  
  16. Yes, but note that it's still recommended that you use semicolon in
  17. general.  You *have* to use it if you want to be backward compatible.
  18. You *ought* to use it for readability and ease of maintenence unless
  19. you're writing very short block that fits on one line along with its
  20. braces:
  21.  
  22.     sort { $a <=> $b } @list;
  23.     sub println { print @_,"\n" }
  24.     do { &one } until $done;
  25.  
  26. but
  27.  
  28.     do {
  29.     &one;    # Put semicolon in case you add another statement after.
  30.     } until $done;
  31.  
  32. Basically, it's one of those features that you can't use in a portable
  33. program right now, but maybe in a year or two it'll start to be considered
  34. portable when most everyone's running version 5.  
  35.  
  36. (On the other hand, I *still* don't use enums in C.  Probably mere paranoia
  37. by now...}
  38.  
  39. Larry
  40.