in reply to Question about reading a file...

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?

Just a something something...

Replies are listed 'Best First'.
Re^2: Question about reading a file...
by raisputin (Scribe) on Nov 04, 2009 at 22:19 UTC
    :) yours :P