Re: problems with getpwent

2005-09-17 Thread John W. Krahn
Binish A R wrote: > Hello, Hello, > I've a doubt with getpwent function. > The following code [ getpwent in list context ] is getting into an infinite > loop: > > #!/usr/bin/perl -l > > while ($ref = [ getpwent() ]) { > print $ref->[0]; > } A reference in boolean context is *ALWAYS* tru

Re: problems with getpwent

2005-09-17 Thread Binish A R
Gerard Robin wrote: On Sat, Sep 17, 2005 at 08:20:55PM +0530 Binish A R wrote: Hello, I've a doubt with getpwent function. The following code [ getpwent in list context ] is getting into an infinite loop: #!/usr/bin/perl -l while ($ref = [ get

Re: problems with getpwent

2005-09-17 Thread Gerard Robin
On Sat, Sep 17, 2005 at 08:20:55PM +0530 Binish A R wrote: > Hello, > > I've a doubt with getpwent function. > The following code [ getpwent in list context ] is getting into an infinite > loop: > #!/usr/bin/perl -l > > > while ($ref = [ getpwent() ]) { > last unless @$ref;