in reply to UID 0 and getpwnam

a nit: it's extra work putting double quotes around variables like "$username". basically, you're telling perl to build '"' . $username . '"'. in this function call, which is a waste of time. don't use double-quotes unless you need them.

as an aside, in perl 6, you'll be able to do something like*

module module_name; my class NoData is Exception { method warn(*@args) { die @args } } my $uid = getpwnam($username) // fail NoData;
which will raise an exception of type NoData (a class localized to your module) if getpwnam($username) returns an undefined value. then leave it to the NoData class to handle the exception appropriately.

*as per Exegesis 4

~Particle ;Þ