home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 4952 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.4 KB

  1. Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!agate!dog.ee.lbl.gov!network.ucsd.edu!nic!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: or puzzlement
  5. Message-ID: <1992Jul24.192137.29710@netlabs.com>
  6. Date: 24 Jul 92 19:21:37 GMT
  7. References: <BrtMFu.D0L@unx.sas.com> <MERLYN.92Jul23070028@romulus.reed.edu> <Brut2B.80J@unx.sas.com>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 24
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <Brut2B.80J@unx.sas.com> kent@manzi.unx.sas.com (Paul Kent) writes:
  14. : perhaps "next" is not as executable as "return". 
  15.  
  16. It's just as executable, and just as embeddable within an expression.
  17. What it isn't just as, is capable of evaluating an expression argument.
  18.  
  19. [How's that for anomalous but useful syntax?  How 'bout let's do it right
  20. and revise English, say, next Friday?  Good, I'll be there.]
  21.  
  22. : here are some attempts..
  23. : [...]
  24. : print STDERR "\n\n and now for loopy tricks\n\n";
  25. : for $d ($d1,$d2)
  26. : {
  27. :     opendir(D, $d) || warn "loop_or: no $d" || next;
  28. :     print STDERR "loop_or: $d must exist cuz we got this far\n"; 
  29. : }
  30.  
  31. Again, these are failing because (without parens) warn is a list operator,
  32. and a list operator eats everything to its right that is of the same
  33. precedence as comma or higher.  Which is the same as saying it eats
  34. everything, since comma is the lowest precedence.
  35.  
  36. Larry
  37.