in reply to Parsing a Formatted Text File

Yes, reading 58 lines to an array is the best solution I can think of. The code doesn't seem to be ugly (but ugliness is in the eye of the beholder):
#!/usr/bin/perl use warnings; use strict; while (not eof) { my @lines = map scalar <>, 1 .. 58; # Process the record. }

Update: Simplified as per Re^2: Parsing a Formatted Text File. Thanks, the unnamed one.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Parsing a Formatted Text File
by Anonymous Monk on Mar 23, 2015 at 14:54 UTC

    No need for the push.

    my @lines = map scalar <>, 1 .. 58;
Re^2: Parsing a Formatted Text File
by GotToBTru (Prior) on Mar 23, 2015 at 14:56 UTC

    Not so much ugly as nit-picky.

    There are templating modules to help you produce formatted reports like this one; are there ones to help you read them?

    Dum Spiro Spero
Re^2: Parsing a Formatted Text File
by Pharazon (Acolyte) on Mar 23, 2015 at 14:53 UTC
    So after pushing the lines into the array would it make since to then call a subroutine to pull the data needed out of the array then write it out to the csv file since each array would equate to one record which will equate to one line in the csv file?