Terminal-Identify

 view release on metacpan or  search on metacpan

lib/Terminal/Identify.pm  view on Meta::CPAN

};

# ============================================================================ #
# Subroutine get_user_name                                                     #
# ============================================================================ #
sub get_username {
    # Initialise the username.
    my $username = "";
    # Define the methods for getting the username.
    my $method1 = getlogin();
    my $method2 = (getpwuid($<))[0];
    my $method3 = $ENV{LOGNAME};
    my $method4 = $ENV{USER};
    # Extract the username.
    $username = ($method1 || $method2 || $method3 || $method4);
    # Return the username.
    return $username;
};

# ============================================================================ #
# Subroutine term_user_shell                                                   #



( run in 0.278 second using v1.01-cache-2.11-cpan-8d75d55dd25 )