in reply to Re: next in while loop not honored
in thread next in while loop not honored

The trivial time that may be saved due to removing a simple test is completely irrelevant. However there is a generally big gain in clarity by simplifying code. In that vein, my $useless_line = <$info>; should simply be <$info>; which is much better at conveying the idea that we really don't want to use the contents of the line just read.

Perl is the programming world's equivalent of English

Replies are listed 'Best First'.
Re^3: next in while loop not honored
by Laurent_R (Canon) on Nov 05, 2014 at 22:21 UTC
    I found time not so trivial when reading several files with 300 M + lines. It also makes the loop cleaner by removing from it things that don't need to be in it. It also make the algorithm slightly simpler when reading a sorted file to remove duplicates or reading in parallel two (or more) files sorted according to the same key to compare data.

    As for the my $useless_line = <$info>;, I would probably not really code it that way, but I thought giving such a name would make it more self-explanatory to the OP, you seem to disagree, maybe I was wrong, I don't know.