this function returns an array reference of array references....

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: thawolfman
this function returns an array reference of array references....

Can you say that in english? :confused:

Does it sound any better if I say "reference to an array of references to arrays"?

I'm querying a database and returning a list of matching records.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
for(my $i=0;$i<@$ids;$i++){
my $j=0;
while (@{@$ids[$i]}){
$output[$i][$j] = shift @{@$ids[$i]};
$j++;
}
}

There, that should convert my reference to an array of references to an actualt two dimensional array.
 

trmiv

Lifer
Oct 10, 1999
14,668
1
81
Originally posted by: notfred
for(my $i=0;$i<@$ids;$i++){
my $j=0;
while (@{@$ids[$i]}){
$output[$i][$j] = shift @{@$ids[$i]};
$j++;
}
}

There, that should convert my reference to an array of references to an actualt two dimensional array.

Yep, that was my answer too.
 

stonecold3169

Platinum Member
Jan 30, 2001
2,060
0
76
heh... I remember this one hell program I had to write one time for my CS 142 class... the main topics of the course were lists and modularity in c++. The professor was a genious, and was obsessed with the idea of having pointers to pointers to pointers, or pointers to classes which had three different private members all of which were pointers to comething else... you're right, it gets to be damn hard to figure out how to dealocate everything and throw all the exceptions you need, and if there is an error it gets tricky to track it down...