in reply to "use strict" and undeclared variables

With use strict in effect you have to declare variables.

You can change your code to read while (my @row = $sth->fetchrow_array()){ to fix it and still use strict;.