Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: shell to perl

by Rich36 (Chaplain)
on Jan 23, 2003 at 23:04 UTC ( #229470=note: print w/replies, xml ) Need Help??


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»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://229470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2021-04-20 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?