Tutorials Point

Google
Web This Site

  Perl Home

  PERL Functions

© 2006 TutorialsPoint.COM


  Home     References     About TP     Advertising  

PERL getlogin Function


Syntax

getlogin


Definition and Usage

Returns the user's name, as discovered by the system function getlogin( ). Under Windows, use the Win32::LoginName( ) function instead.

Return Value

  • undef on failure

  • User's login name

Example

Try following example:

#!/usr/bin/perl

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

print "Login ID is $login\n";



Printer Friendly



  

Advertisement