A Perl version of "wall"

Kayvan Sylvan kayvan at mrspoc.Transact.COM
Sat May 5 17:36:34 AEST 1990


In article <264186E0.17B3 at tct.uucp> chip at 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" |



More information about the Alt.sources mailing list