in reply to fetchrow_array loop in perl 5.10

Did you re-install the packages when you upgraded from 5.8 to 5.10, and are you certain that your PERL5LIB is pointing to the right location?   In this case, I trust the implementation of DBI implicitly, and your code looks okay, so I suspect that there was a problem introduced by the upgrade process that you used.   Some of this stuff uses “XS” (C-language code, libraries, etc.) very extensively, and upgrades can upset its delicate clockwork.   A clean-reinstall of the package will, for example, recompile those components.   Also, you could well have two packages out there (in two different Perl-version-specific directories), and be pointing to the wrong one (which might have the same name and version-code).