in reply to DBI question

besides the excellent advice that Corion and dragonchild provided, let me comment on what you are doing...

you are getting a packed suitcase (the reference to the result), unpacking it one by one and packing it once again (your while loop), only to dump it all out again.

why not just do the following?

my $res = $sth->fetchall_arrayref; print Dumper $res;

You can even do the following

use JSON; my $json = to_json($res);
--

when small people start casting long shadows, it is time to go to bed