hdb: I could only get that to work my changing it to..
open(my $in_fh = IO::File->new, "<", $infile) or die "Can't open $infile: $!.\n"; close $in_fh; my $chunk =~ s/[\f\r\n]//g; my @statement = split '`', $chunk; ## %desc stuff here my %data; $/ = "`\n"; foreach my $line (@statement) { .. }
instead of:
my %data; $/ = "`\n"; foreach my $line (<DATA>) { .. }
Is %data set to the file variable in your version? I think shifting the first field may be a mistake of mine, too. Doing this doesn't parse the 200~ fields. my output was:
Unknown data 020000000123 Unknown data 500 Unknown data 300 Unknown data 510 Unknown data 539 Unknown data 510 Unknown data 539 Unknown data 599 Unknown data 570 Unknown data 540 Unknown data 550 Unknown data 690 Unknown data 701 Unknown data 200~ $VAR1 = { '501' => { 'rate1' => '11.150%', 'rate2' => '.030547%' }, '530' => [ { 'f8' => '83850', 'f6' => '1237', 'f1' => '09182013', 'f9' => 'Payments by Check', 'f5' => '609', 'f2' => '09182013', 'f7' => '10338-', 'f4' => '12184-' }, { 'f8' => 'Payments by Check', 'f6' => '11688-', 'f1' => '10082013', 'f9' => 'K', 'f5' => '512', 'f2' => '10082013', 'f7' => '72162', 'f4' => '12200-' } ] };

In reply to Re^2: Statement Parsing and Rendering by PerlSufi
in thread Statement Parsing and Rendering by PerlSufi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.