Array of Array refs
- From: googleAcct@xxxxxxxxxxxxxxx (Brian)
- Date: 27 May 2007 21:00:47 -0700
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, \@r1;
push @tRespsA, \@r2;
push @tRespsA, \@r3;
foreach my $tRowRef ( @tRespsA ) {
my $tCnt=0;
foreach my $tFld (@fieldList) {
#if ( $tRowRef->[ $tCnt] eq "") { next; }
print $tFld . "='" . $tRowRef->[ $tCnt++ ] . "' \r";
}
}
.
- Follow-Ups:
- Re: Array of Array refs
- From: Brian
- Re: Array of Array refs
- From: Brian
- Re: Array of Array refs
- From: Paul Lalli
- Re: Array of Array refs
- From: Rob Dixon
- Re: Array of Array refs
- Prev by Date: Re: accesing a hash of an array of hashes
- Next by Date: What modules should I use to transfer a video scrip through the net?
- Previous by thread: Net::BGP advise
- Next by thread: Re: Array of Array refs
- Index(es):