CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=43200
server: Combust/Plack (Perl)
vary: Accept-Encoding
content-encoding: gzip
content-length: 2159
content-type: text/html; charset=utf-8
last-modified: Sat, 11 Oct 2025 15:46:18 GMT
traceparent: 52115ab56686dafc16de1ff1439e776f
strict-transport-security: max-age=15768000
Re: Iterator::Diamond (Was: Re: Fighting the Good Fight against spam deluge) - nntp.perl.org
Front page | perl.perl5.porters |
Postings from August 2008
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About

Re: Iterator::Diamond (Was: Re: Fighting the Good Fight against spam deluge)
From:
Ben MorrowDate:
August 2, 2008 14:03Subject:
Re: Iterator::Diamond (Was: Re: Fighting the Good Fight against spam deluge)Message ID:
qduem5-9ju.ln1@osiris.mauzo.dyndns.orgQuoth jvromans@squirrel.nl (Johan Vromans): > > The question remains to what level it must be compatible with the > current <> implementation. When a file list is passed, I'd say that > @ARGV should remain untouched. But should ARGV, $ARGV and ARGVOUT > still reflect the status of the iterator, as they do with <> ? No, certainly not. However, given that the iterator is an object, something like this should be possible: my $it = Iterator::Files->new(files => \@files, inplace => '.bak'); while (<$it>) { print "current line: $_"; print 'current filename: ' . $it->file; print 'current line: ' . $it->line; # same semantics as $. print 'current output filename: ' . $it->output; } You could also make the iterator object itself a blessed glob, so that print $it "foo"; becomes the equivalent of print ARGVOUT "foo"; (If you were feeling *really* clever, you could create a glob with IoIFP and IoOFP different, so that getc $it; read from the input file and print $it "foo"; wrote to the output file :) ). Ben -- You poor take courage, you rich take care: The Earth was made a common treasury for everyone to share All things in common, all people one. 'We come in peace'---the order came to cut them down. [ben@morrow.me.uk]
- Re: Diamond iteration (was: Fighting the Good Fight against spam deluge) by Tom Christiansen
- Re: Diamond iteration (was: Fighting the Good Fight against spamdeluge) by H.Merijn Brand
- Re: Iterator::Diamond (Was: Re: Fighting the Good Fight against spam deluge) by Tom Christiansen
- Re: Fighting the Good Fight against spam deluge by Johan Vromans
- Re: Fighting the Good Fight against spam deluge by chromatic
- Re: Iterator::Diamond (Was: Re: Fighting the Good Fight againstspam deluge) by Aristotle Pagaltzis
- Re: Iterator::Diamond (Was: Re: Fighting the Good Fight against spam deluge) by Johan Vromans
- Re: Iterator::Diamond (Was: Re: Fighting the Good Fight against spam deluge) by Ben Morrow
- Fighting the Good Fight against spam deluge (was: Senatorial (Senescent?) reflective pause) by Tom Christiansen
- Re: Fighting the Good Fight against spam deluge (was: Senatorial(Senescent?) reflective pause) by Tim Bunce
- Re: Fighting the Good Fight against spam deluge (was: Senatorial (Senescent?) reflective pause) by jm
- Re: Fighting the Good Fight against spam deluge (was: Senatorial (Senescent?) reflective pause) by jvromans
- Diamond iteration (was: Fighting the Good Fight against spam deluge) by Tom Christiansen
- Re: Fighting the Good Fight against spam deluge by Roland Giersig
- Re: Fighting the Good Fight against spam deluge by Johan Vromans
- Re: Fighting the Good Fight against spam deluge by chromatic
- Re: Fighting the Good Fight against spam deluge by H.Merijn Brand
- Re: Fighting the Good Fight against spam deluge by Roland Giersig
- Re: Fighting the Good Fight against spam deluge by jvromans
- Re: Fighting the Good Fight against spam deluge by Tom Christiansen
- Re: Fighting the Good Fight against spam deluge by Johan Vromans
- Re: Fighting the Good Fight against spam deluge by Roland Giersig
- Re: Fighting the Good Fight against spam deluge by H.Merijn Brand
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About