getlogin
Returns the current login from /etc/utmp (Unix systems only), if any. If null, use getpwuid . For example:
getpwuid
$login = getlogin || getpwuid($<) || "Intruder!!";
[ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ]