in reply to (jeffa) Re: whoami?
in thread whoami?

The UID and GID are kept in the standard Perl variables $</$> and $(/$). You can then discover the username via getpwuid:
print "Your username is: ", getpwuid($<) || "unknown???", "\n";
This allows you to get this information without ever needing to spawn an external process.