You are viewing the version of this documentation from Perl 5.005_01. View the latest version
getlogin

Implements the C library function of the same name, which on most systems returns the current login from /etc/utmp, if any. If null, use getpwuid().

$login = getlogin || getpwuid($<) || "Kilroy";

Do not consider getlogin() for authentication: it is not as secure as getpwuid().