in reply to Re^2: Seperating Fixed Line Feed into Fields
in thread Seperating Fixed Line Feed into Fields

If you want to save the array off each time (it didn't look like you were doing that in your original code) you can declare an array outside of the loop and push the arrayref of the fields into that larger array. e.g.
my @big_list_of_fields; while (<DATA>) { ... # unpacking here ... push @big_list_of_fields, \@fields; }
Edit: I may be reading your question incorrectly. It should declare a new @fields inside each loop iteration though, so there should be nothing added to the array, it's a fresh array each iteration.

Replies are listed 'Best First'.
Re^4: Seperating Fixed Line Feed into Fields
by drodinthe559 (Monk) on Jun 10, 2009 at 21:01 UTC
    Thank you, that worked. This is a huge improvement than what I had before. Not that I'm thinking about it, I should be able to go from unpack into Excel spread sheet right?
      With the arrays, yes, it will make it much easier. Assuming you have your worksheet open (exercise left to the OP =):
      my $row = 0; while (<DATA>) { # data loop is here # unpack, etc. $worksheet->write_row($row++, 0, \@fields); }