in reply to Limiting a glob
perl -e 'while ($s=<*>) { print $s,"\n"; sleep 5 }'
As you can see a glob can read filenames one file at a time (hopefully perl really buffers the filenames in the background and doesn't read them in all at once). You might change it to something like this:
use strict; use warnings; my @files; my $filecount=0; while (my $s=<*>) { push @files, $s; if (++$filecount>=100) { DoTheMoveWith(@files); $filecount=0; } } DoTheMoveWith(@files) if (@files);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Limiting a glob
by tirwhan (Abbot) on Mar 09, 2009 at 18:13 UTC | |
by zod (Scribe) on Mar 09, 2009 at 18:19 UTC | |
Re^2: Limiting a glob
by zod (Scribe) on Mar 09, 2009 at 17:51 UTC |
In Section
Seekers of Perl Wisdom