use CGI; my $cgi = CGI->new(); my $username = $cgi->remote_user();