ActiveState homepage
docs.activestate.com
ActivePerl 5.26 Documentation
  • Get ActivePerl
      Release notes Windows installation Linux Installaton macOS Installation License
  • Get Started
      Windows Perl 5.26 docs
  • Contact Us

getlogin - perldoc.perl.org
Home  > Language reference > Functions > getlogin
Perl 5 version 26.3 documentation

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.

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

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

    Portability issues: getlogin in perlport.

Documentation built with Hugo using the Material theme.
ActiveState Platform   Downloads   Community   Code Recipes  
© 2020 ActiveState Software Inc. All rights reserved. Trademarks. Privacy Policy.