home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1274 < prev    next >
Internet Message Format  |  1990-12-28  |  805b

  1. From: kayvan@mrspoc.Transact.COM (Kayvan Sylvan)
  2. Newsgroups: alt.sources,comp.unix.questions,comp.lang.perl
  3. Subject: Re: A Perl version of "wall"
  4. Message-ID: <KAYVAN.90May5003631@mrspoc.Transact.COM>
  5. Date: 5 May 90 07:36:34 GMT
  6.  
  7.  
  8. In article <264186E0.17B3@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes:
  9.  
  10. [... a rather nice version of wall ...]
  11.  
  12.     $_ = `who am i 2>/dev/null`;
  13.     chop;
  14.     ($me) = split;
  15.     $me = "Somebody" unless $me;
  16.  
  17. Instead of the above, I would do:
  18.  
  19.     ($me = getlogin) || (($me) = getpwuid($<)) || ($me = "Somebody");
  20.  
  21. No extra process.
  22.  
  23.             ---Kayvan
  24. -- 
  25. | Kayvan Sylvan @ Transact Software, Inc. -*-  Los Altos, CA (415) 961-6112 |
  26. | Internet: kayvan@{mrspoc.Transact.com, eris.berkeley.edu, largo.ig.com}   |
  27. | UUCP: ...!{apple,pyramid,bionet,mips}!mrspoc!kayvan "Imagine Cute Saying" |
  28.