http://qs321.pair.com?node_id=1036588

zBernie has asked for the wisdom of the Perl Monks concerning the following question:

We use a widely available perl script named "activity mail" to send email to developers who commit file to our cvs repository. The script sends a diff attachment with the email. The file name of the attachment is created like this:

filename=$user-@gm5,4,3,2,1,0-diff.txt

The problem is, regardless of who commits files, the $user is ALWAYS "bernie", which is my username on the cvs server. I found that the perl getlogin function always returns "bernie", regardless of who commits files:

my $user = getlogin || getpwuid($<) || "unknown";

I bit more research, and I found that get login returns the user name associated with the controlling terminal. But is a remote CentOS 5.5 server. So why does getlogin think that "bernie" is logged into the controlling terminal on this remote server? -Thanks