in reply to shell to perl
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);
«Rich36»
|
---|
In Section
Seekers of Perl Wisdom
in reply to shell to perl
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);
|
---|