[oak perl] perl can bite me

cajun at cajuninc.com cajun at cajuninc.com
Mon Nov 25 19:36:43 CST 2002


Rats.... David beat me to it....

Quoting David Alban <extasia at mindspring.com>:

> Belden,
> 
> At 2002/11/25/17:20 -0800 Belden Lyman <blyman at iii.com> wrote:
> >      % perl
> >      # perl in interactive mode
> >      for my $login (qw(blyman root daemon nobody)) {
> >        my $pwent = getpwnam( $login );
> >        print $pwent ? "+ $login\n" : "- $login\n";
> >      }
> >      __END__
> >      + blyman
> >      - root      <-- huh?!
> >      + daemon
> >      + nobody
> > 
> > Coffee/beer/drink_of_your_choice is on me to the first
> > person (except you, George [0] ) who can tell us why
> > this isn't a bug in Perl.
> 
> Your doing the:
> 
>   $uid   = getpwnam($name);
> 
> invocation.  root's uid is zero, which is false.
> 
> You probably should test for defined() rather than truth.
> 
> Did I win? :-)
> 
> David
> -- 
> Live in a world of your own, but always welcome visitors.
>                                  ***
> Join us at sig-beer-west! 
> http://www.gerasimov.net/~alban/sig.beer.west.html
> Unix sysadmin available:   http://www.gerasimov.net/~alban/jac/resume.html
> 




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/



More information about the Oakland mailing list