I find that getlogin(), which has always worked for me on past versions of debian, doesn't work on ubuntu precise. Is this a bug? A feature?
Here was the best workaround I was able to find:
my $user = getlogin() || `whoami`; $user =~ s/\n$//;
In reply to getlogin works on debian but not ubuntu? by bcrowell2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |