I'd either use 'select *' and fetch with fetchrow_hashref (
my $value = $sth->fetchrow_hashref->{field_name}) so you don't need those ugly array assignments, or code the first option with prepare_cached in a subroutine, depending on how efficient this really needs to be:
sub get_value {
my ($dbh, $field_name) = @_;
my $sth = $dbh->prepare_cached("select $field from table where id =
+?");
my $value = $sth->fetchrow_array;
$sth->finish;
$value;
}