Tutorials Point


  Perl Home

  PERL Functions

© 2011 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

Online Image Processing

Indian Baby Names