Hi All-
I am trudging through some DBI, XML, etc.. I had a problem and was
baffled by how to get at array elements out of a series of pushed
array refs. But, by simplifying the problem, I found that the syntax I
used was in error. here is the small sample, already debugged. Hope
this helps someone...
#!/usr/bin/perl
my @tRespsA;
my @fieldList = ( "one", "two", "three", "four" );
my @r1 = ( 1, 2, 3, 4 );
my @r2 = ( 13, 14, 15, 16 );
my @r3 = ( 23, 24, 25, 26 );
push @tRespsA, [EMAIL PROTECTED];
push @tRespsA, [EMAIL PROTECTED];
push @tRespsA, [EMAIL PROTECTED];
foreach my $tRowRef ( @tRespsA ) {
my $tCnt=0;
foreach my $tFld (@fieldList) {
#if ( $tRowRef->[ $tCnt] eq "") { next; }
print $tFld . "='" . $tRowRef->[ $tCnt++ ] . "' \r";
}
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/