I think I would take this one step further and bind the variable that you are passing to the SQL.
use strict;
use DBI;
# make the connection the way you have shown
my @resultrow = ();
my $sth = $dbh->prepare("select ID from study
where NAME=?");
$sth->execute($unique_search_string_here);
my $resultref = $sth->fetchrow_arrayref;
if (ref($resultref) eq 'ARRAY') {
@resultrow = @{$resultref};
# do something with $resultrow[0]
}
else {
# check for error in $DBI::errstr, etc.
}
--
BigJoeLearn patience, you must.
Young PerlMonk, craves Not these things.
Use the source Luke.