in reply to Re: Count number of lines?
in thread Count number of lines?

On a large file, that could be a very expensive operation. I'd suggest (in terms of 1 liners)
perl -ae '1 while <>;print $.' users.dat

mr.nick ...

Replies are listed 'Best First'.
Re: Re: Re: Count number of lines?
by larryk (Friar) on Jun 20, 2001 at 12:32 UTC
    update: I may have my indentation mixed up! I'd still like to know if yours is faster than abigail's though.

    how is this faster than the above? it looks like it's doing the same thing (while through the file and print $.). is there some sort of overhead with a continue block?

    also, is -a doing something special? I'm confused because perl --help says -a    autosplit mode with -n or -p (splits $_ into @F) which doesn't seem to apply here.

    "Argument is futile - you will be ignorralated!"