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