missing last line

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is there a reason why this code would miss the last user?

@nameList = `cat '/etc/passwd'`;

foreach my $userName (@nameList) {

Re: missing last line

jammer wrote:
Quoted text here. Click to load it

Try this and see if it works better:

while ( my @pw = getpwent ) {
     print "@pw\n";

Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

Site Timeline