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