On Fri, 1 Aug 2008 17:59:05 -0700, chromatic <chromatic@wgz.org> wrote:
> On Friday 01 August 2008 12:28:30 Johan Vromans wrote:
>
> > Besides, it is very easy and straightforward to write:
> >
> > { local (@ARGV) = @filelist;
> > $input = Iterator::Files->new;
> > while ( <$input> ) { ... }
> > }
>
> Ideally, I'd like to see new features in Perl 5 rely on fewer globals and
> require fewer lines of code. Succinctness and clarity sometimes go together.
This is a new *MODULE*, not a new feature.
I completely agree with Johan here.
What I was wondering, can you switch mode during while (<>) ?
my $input = Iterator::Files->new;
while (<$input>) {
...;
m/some situation/ and # I want all files to come to open different
$input->magic ("stdin");
...;
}
--
H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/