Re: [perl #132885] AutoReply: .next-handle seems to change handles but doesn't

[email protected] ("brian d foy via RT")
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
I can fix this by closing the old file handle and checking the new
one, but that seems like way to much work at the user level.

    quietly {
        my $limit = 5;
        for lines() {
            state $lines = 1;
            FIRST { $*ARGFILES.on-switch = { put "NEW FILE"; $lines = 1 } }
            if $lines > $limit {
                $*ARGFILES.next-handle.close;
                last unless $*ARGFILES.opened;
                next;
                }
            put "{$*ARGFILES.path}:{$lines++} $_";
            }
        }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.