in reply to (solaris) pbrun and the real user id
Actually, it depends on the implementation of su. I ended up using the who am i approach but it isn't full proof.
sub whoami { return (split /\s+/, `/bin/who am i`)[0]; } [download]
Jason L. Froebe
Team Sybase member
No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1