in reply to foolish/simple sql question

Please use <code> tags instead of <pre>.

Anyway, something like:

my $sth = $dbh->prepare(qq{SELECT st8a, st8b FROM sample WHERE id=$id} +); $sth->execute() || die "Error executing query: " . $dbh->errstr . "\n" +; my ($val1,$val2) = $sth->fechrow_array();
Or even
my ($val1,$val2) = $dbh->selectrow_array("SELECT st8a, st8b FROM sampl +e WHERE id=$id");
Should work.

And you should watch what people can put in the $id variable, either make sure it's number, use $dbh->quote() or use placeholders.

See the DBI docs.