sera has asked for the wisdom of the Perl Monks concerning the following question:
I am storing the result of a query in an array. my array looks like
(["a","b","c"] ["a","b","d"])
I want to compare the elements of the first row with the corresponding elements of the second row, and if the first 2 sets matches i want to display
a b c,d
with my current code my result look like
a b b a b d
following is my code
my arr_ref= $sth->fetchall_arrayref(); foreach my $row(@$arr_ref) { #missing something here my ($ele1,$ele2,$ele3)= @$row; print "$ele1\t", print "$ele2\t", print "$ele3\n", }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to compare the rows in a 2d array
by Corion (Patriarch) on Mar 04, 2010 at 15:40 UTC | |
|
Re: how to compare the rows in a 2d array
by almut (Canon) on Mar 04, 2010 at 15:55 UTC | |
|
Re: how to compare the rows in a 2d array
by youlose (Scribe) on Mar 04, 2010 at 19:03 UTC | |
|
Re: how to compare the rows in a 2d array
by ack (Deacon) on Mar 04, 2010 at 20:34 UTC |