1. Perl
  2. builtin functions
  3. here

getpwuid function - get user information (user name)

To get the username , use the getpwuid function and the predefined variable $> as follows.

my $user = getpwuid($>);

You can get the user name by specifying the user ID in the argument of getpwuid.

Related Informatrion