Just another Perl shrine | |
PerlMonks |
Get the currently logged in User nameby irah (Pilgrim) |
on Nov 05, 2011 at 09:45 UTC ( [id://936127]=perlquestion: print w/replies, xml ) | Need Help?? |
irah has asked for the wisdom of the Perl Monks concerning the following question: Greetings to Monks!, I used few functions such as getlogin, getpwuid and in some other way including environment variable to get the currently logged in user name in Linux. Everything works when I execute the Perl script from Linux prompt. When I call the same script from web programming language, it gives the user name as "www-data" since it Apache server running my program as www-data user. I have to get the user name of the currently login user name instead of some other name. Is there any way to achieve this in Perl?. Thanks in Advance!.
Back to
Seekers of Perl Wisdom
|
|