home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5591 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.7 KB  |  44 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!decwrl!mips!mips!odin!stantz
  3. From: stantz@sgi.com (Mark Stantz)
  4. Subject: Re: 4.035 bug or feature...why does this run?
  5. Message-ID: <1992Aug28.213055.20343@odin.corp.sgi.com>
  6. Sender: news@odin.corp.sgi.com (Net News)
  7. Nntp-Posting-Host: sierra.corp.sgi.com
  8. Organization: Silicon Graphics, Inc.
  9. References: <1992Aug27.171036.28995@odin.corp.sgi.com> <BtnMC5.51s@news.cso.uiuc.edu> <1992Aug28.185620.9841@netlabs.com>
  10. Date: Fri, 28 Aug 1992 21:30:55 GMT
  11. Lines: 31
  12.  
  13. In article <1992Aug28.185620.9841@netlabs.com> lwall@netlabs.com (Larry Wall) writes:
  14. > Yes, but note that it's still recommended that you use semicolon in
  15. > general.  You *have* to use it if you want to be backward compatible.
  16. > You *ought* to use it for readability and ease of maintenence unless
  17. > you're writing very short block that fits on one line along with its
  18. > braces:
  19. >
  20. >    sort { $a <=> $b } @list;
  21. >    sub println { print @_,"\n" }
  22. >    do { &one } until $done;
  23.  
  24.     Er... what was wrong with:
  25.  
  26.         sort { $a <=> $b; } @list;
  27.         sub println { print @_,"\n"; } 
  28.         do { &one; } until $done;
  29.  
  30.     Or is this one of those religious arguments again?
  31.  
  32.     Such arguments notwithstanding, my concern is that now and then I 
  33. just plain forget to put the semi-colon at the end of a line.  Call it a typo
  34. or a mental lapse.  Usually perl complains and I fix it instantly...it's not
  35. really a problem, and the same thing happens to me in C all the time.  The 
  36. real trouble comes when you post code to the net not realizing that you 
  37. forgot one of those semi-colons, and it doesn't run for half the people that 
  38. try to use it, even though it works fine for you.  
  39.  
  40.     At the least, 'perl -w' should warn you about the backward 
  41. incompatability problem.
  42.  
  43.     -Mark
  44.