RE: Parsing Fixed Length data

2003-01-29 Thread Toby Stuart
> > > my $i=0; > > > while () > > > { > > > @fields = unpack("A10A10A7", $_); > > > > my @fields = unpack 'A10A10A7', $_; > > > > > > > $records{$i} = { > > > > Why not just use an array? > > different strokes for different strokes :) Now that

RE: Parsing Fixed Length data

2003-01-29 Thread Toby Stuart
> -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 30, 2003 2:16 PM > To: [EMAIL PROTECTED] > Subject: Re: Parsing Fixed Length data > > > Toby Stuart wrote: > > > > use strict; > > use warnings;

Re: Parsing Fixed Length data

2003-01-29 Thread John W. Krahn
Toby Stuart wrote: > > use strict; > use warnings; > > my %records; > > my $surname; > my $given_name; > my $price; You create these three variables because? > my @fields; You should declare this _inside_ the loop. > my $i=0; > while () > { > @fields = unpack("A10A10A7", $_);

Re: Parsing Fixed Length data

2003-01-29 Thread John W. Krahn
Kevin Old wrote: > > Hello all, Hello, > I have run into a situation that I've never faced before. I've always > parsed delimited (comma, pipe, etc) data. Now I'm faced with parsing > fixed-width data. That's fine and I understand how to do it and have > even found a module for it (Parse::Fix

RE: Parsing Fixed Length data

2003-01-29 Thread Toby Stuart
> -Original Message- > From: Kevin Old [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 30, 2003 12:18 PM > To: [EMAIL PROTECTED] > Subject: Parsing Fixed Length data > > > Hello all, > > I have run into a situation that I've never faced befo

Re: Parsing Fixed Length data

2003-01-29 Thread Wiggins d'Anconia
Kevin Old wrote: Hello all, I have run into a situation that I've never faced before. I've always parsed delimited (comma, pipe, etc) data. Now I'm faced with parsing fixed-width data. That's fine and I understand how to do it and have even found a module for it (Parse::FixedLength). Say I ha

Parsing Fixed Length data

2003-01-29 Thread Kevin Old
Hello all, I have run into a situation that I've never faced before. I've always parsed delimited (comma, pipe, etc) data. Now I'm faced with parsing fixed-width data. That's fine and I understand how to do it and have even found a module for it (Parse::FixedLength). Say I have the following s