Maybe a simple approach?
use strict; use warnings; my @log = (); while (<DATA>){ chomp; push @log, $_; if (scalar@log ==3){ do_stuff(\@log); @log = (); } } sub do_stuff{ my $ref = shift; print join ":", @$ref, "\n"; } __DATA__ 1 2 3 4 5 6
Gives :
1:2:3: 4:5:6:
Argh. Only just seen your update... what solution did you go for in the end?
In reply to Re: Question about reading a file...
by BioLion
in thread Question about reading a file...
by raisputin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |