in reply to Re: Using in multiple passes
in thread Using in multiple passes

And that won't work if any of the elements in @ARGV are pipe-opens or a non-seekable STDIN.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: Re: Using in multiple passes
by fundflow (Chaplain) on Oct 25, 2000 at 18:25 UTC
    Yes, of course.

    Just for curiousity, i tried the following:

    #!/usr/bin/perl -w while(<>) { print }; seek(STDIN, 0, 0) or die; print "-----PASS 2-----\n"; while(<>) {print}
    and ran it with:     > ./t.pl < t.pl and it did read the file twice! How come?
    (I was expecting an error like 'non-seekable file' or so.)

    When doing

    >cat t.pl | perl t.pl
    it died where it should have (i.e. in the seek()).