You might wish to get in a habit of checking for $err as well. In some situations, if you $sth->execute fails, and you $sth->fetchrow Perl may (will) exit entirely. Checking for errors is a good habit to get into -- it will prepare you for the 'next database'
spectre#9 -- more dangerous than acme