in reply to use of DBI perl function fetchall_arrayref
In the code you posted you wrote:# Create an anonymous arrayref my $arrayref = [1,2,3]; # Create a reference to an existing array my @array = (1,2,3); my $arrayref2 = \@array; # Get a single value from the arrayref: my $one = $arrayref2->[0]; # Get all the values from the arrayref: my ($one,$two,$three) = @$arrayref2;
Which is putting the arrayref provided by DBI inside another arrayref. Instead do this:[$sql_return]
It might help you visualize the data structure if you use Data::Dumper, like this:@$sql_return
use Data::Dumper; #... my $sql_return = $sth_tss->fetchall_arrayref; print Dumper $sql_return;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use of DBI perl function fetchall_arrayref
by EvanK (Chaplain) on Jan 26, 2007 at 15:24 UTC |