in reply to skip forward through file

As an explanation for the working code already published elsewhere in this thread, perhaps what's missing in your code is that you had presumed that:
<DIFF>;
automatically assigns to $_. No such thing.

I'm curious about what you read or how you figured that false fact out, because it's not said in any official documentation (in fact, the official documentation specifically contradicts it in a few places). And yet I've seen more than one person make that false attempt.

If you read it somewhere, can you post that reference so we can track down the bad meme?

Thanks!

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: skip forward through file
by Abigail-II (Bishop) on Jul 04, 2002 at 14:50 UTC
    Well, I can come up with a reason why many people think so: because the standard idiom of:
    while (<DIFF>)
    assigns to $_. And for a lot of people, after their introduction course, the only way the remember to iterate over a file is the above idiom.

    Abigail

Re: Re: skip forward through file
by broquaint (Abbot) on Jul 04, 2002 at 15:04 UTC