in reply to Table building confusion Help Wanted
Well I can perform your desired operation with the following code:
#!/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 @array2; for (my $i=0;$i<3;$i++) { my @array1 = ($dataA[$i],$dataB[$i],$dataC[$i],$dataD[$i]); push @array2, [@array1]; } foreach my $r (@array2) { foreach my $p (@{$r}) { print $p . "\n"; } }
You might consider looking at a hash of arrays 1977 using the following code
my %dramatis_personae = ( humans => [ 'hamnet', 'shakespeare', 'robyn', ], faeries => [ 'oberon', 'titania', 'puck', ], other => [ 'morpheus, lord of dreams' ], ); Access it like this: foreach my $group (keys %dramatis_personae) { print "The members of $group are\n"; foreach (@{$dramatis_personae{$group}}) { print "\t$_\n"; } }
I wish I could point to the specific area where you are having problems, but I have to get home for dinner.
I will check back later tonight and analyze your code if another (smarter) monk hasn't already done so.
Best of luck!
- f o o g o d
|
|---|