in reply to Logging script usage when executed via sudo on *nix

I think sudo sets some environment variables that you can check for in your perl script...

From the sudo manpage:

SUDO_USER Set to the login of the user who invoked sudo SUDO_UID Set to the uid of the user who invoked sudo SUDO_GID Set to the gid of the user who invoked sudo

-Blake