Extract user name from perl script -
i want extract user name, executing perl script, within script itself.
i executing whoami
linux command perl follows , works pretty well.
my $whoami = `whoami`; chomp $whoami; print $whoami;
my intention away calling system commands perl script. therefore looking perl only solution. wondering if there cpan module available can extract system information.
your suggestions in regards appreciated.
perl -le 'print scalar getpwuid $<'
Comments
Post a Comment