Perl Programming Documentation
Download Perl
Explore

Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

Tools

- Preferences

# getlogin

Perl 5 version 16.0 documentation
Go to top
Show recent pages
Recently read

# getlogin

Perl functions A-Z | Perl functions by category | The 'perlfunc' manpage

- getlogin

  This implements the C library function of the same name, which on most systems returns the current login from /etc/utmp, if any. If it returns the empty string, use `getpwuid`.

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

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

  Portability issues: getlogin in perlport.