in reply to Looping through MySQL

Call me crazy, but if I were you I would be using selectrow_array or selectrow_hashref for your data retrieval. For instance:
$href = $dbh->selectrow_hashref("SELECT name,parent FROM category WHER +E id = '$ids'") or die $dbh->errstr; push(@info, $href{'name'});
I believe that would be better suited to your needs.