The code below will give you the same output as "whoami" without having to make a system call.
my $id = (getpwuid($<))[0]; print qq($id\n);
In reply to Re: shell to perl
by Rich36
in thread shell to perl
by suekawar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |