at the end of the loop where you are reading from the array and printing the values out.$i = 0;
Having said that, I'd use array of hashes instead of array of arrays to store such data. Hashes lend themselves very nicely for storing records.
Much smaller and clearer.#!/usr/bin/perl-Tw use strict; my @dataA = ("A1", "C1", "S1"); my @dataB = ("007", "008", "005"); my @dataC = ("999-99-9999", "888-88-8888", "777-77-7777"); my @dataD = ("self", "spouse", "son"); my $count = 3; my @major_PER_Data; # save it for (0 .. $count - 1) { push @major_PER_Data, { ID => $dataA[$_], CUST => $dataB[$_], SSN => $dataC[$_], RELATION => $dataD[$_], }; } # print it for my $PER_item (@major_PER_Data) { print "$PER_item->{ID}\n"; print "$PER_item->{CUST}\n"; print "$PER_item->{SSN}\n"; print "$PER_item->{RELATION}\n"; }
/prakash
In reply to Re: Table building confusion Help Wanted
by PrakashK
in thread Table building confusion Help Wanted
by basicdez
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |