Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Statement Parsing and Rendering

by PerlSufi (Friar)
on Oct 25, 2013 at 14:34 UTC ( [id://1059686]=note: print w/replies, xml ) Need Help??


in reply to Re: Statement Parsing and Rendering
in thread Statement Parsing and Rendering

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-' } ] };

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1059686]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-24 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found