Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL getlogin Function
Syntax
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";
|
|

|
|
|