home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5666 < prev    next >
Encoding:
Text File  |  1992-09-01  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cs.utexas.edu!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: nuther perl-idiom question..
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Sep1.232723.5911@news.eng.convex.com>
  8. Date: Tue, 1 Sep 1992 23:27:23 GMT
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. References: <Btx90n.BMG@unx.sas.com>
  11. Nntp-Posting-Host: pixel.convex.com
  12. Organization: Convex Computer Corporation, Colorado Springs, CO
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 17
  17.  
  18. From the keyboard of kent@manzi.unx.sas.com (Paul Kent):
  19. :in kornshell, one can say:
  20. :
  21. :  x=${foo:-default}
  22. :
  23. :which assigns x the value of foo if foo is defined, and "default" otherwise...
  24.  
  25. In Perl, one often writes:
  26.  
  27.     $x = $foo || "default";
  28.  
  29. --tom
  30. -- 
  31.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  32.  
  33. Besides, it's good to force C programmers to use the toolbox occasionally. :-)
  34.         --Larry Wall in <1991May31.181659.28817@jpl-devvax.jpl.nasa.gov>
  35.