So, I don't know anything about running Perl in a Windows environment, but I can point out one or two very obvious thing(s) you are doing wrong. First, you want 'use DBI;' rather than 'use DBD::Oracle;' unless there is some weirdness about using SQL::Statement (which I have never used) that I don't know about. Second, you want to retrieve your results into some kind of data structure, not just let them fall to the floor:
use strict;
use DBI;
# make the connection the way you have shown
my @resultrow = ();
my $resultref = $dbh->selectrow_arrayref("select ID from study
where NAME='$unique_search_string_here'");
if (ref($resultref) eq 'ARRAY') {
@resultrow = @{$resultref};
# do something with $resultrow[0]
}
else {
# check for error in $DBI::errstr, etc.
}
This will work only where you have a unique search string that returns only a single row of data ... if you can have multiple rows, use selectall_arrayref, which will give you a reference to an array of array references. Take a few moments and familiarize yourself with DBI.