develooper Front page | perl.perl5.porters | Postings from August 2008

Re: Fighting the Good Fight against spam deluge

Thread Previous | Thread Next
From:
Johan Vromans
Date:
August 1, 2008 12:28
Subject:
Re: Fighting the Good Fight against spam deluge
Message ID:
m2tze4edr5.fsf@phoenix.squirrel.nl
Roland Giersig <rgiersig@cpan.org> writes:

> Could we please have a more general Iterator::Files that takes a list
> of filenames with new()?
> 
>    $input = Iterator::Files->new(@filelist);

I don't think that is a good idea. 

Since Iterator::Diamond is intended to behave like <>, it must operate
on global @ARGV, $ARGV and ARGVOUT. When you can say:

   $input = Iterator::Files->new(@filelist);

you can also say:

   $input1 = Iterator::Files->new(@file1list);
   $input2 = Iterator::Files->new(@file2list);

and things would terribly screw up.

Besides, it is very easy and straightforward to write:

  { local (@ARGV) = @filelist;
    $input = Iterator::Files->new;
    while ( <$input> ) { ... }
  }

Alternatively, I could limit the use of @ARGV, $ARGV and ARGVOUT to
the case where no explicit file list is used.

> Apart from that: OK.

Thanks.

-- Johan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About