http://www.perlmonks.org?node_id=924655


in reply to Mysql select and store one field

When you retrieve only one row, there's no need for a loop. You can simply write

my ($post) = $sth->fetchrow_array;