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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -