I'm using a function from DBI that needs a hash reference according to the 
documentation, and I don't know how to turn $_ into one. The section of code I 
have is:
   if ($record{"Author"}) {
      my @indfields = split(/\|/, $record{"Author"});
      foreach (@indfields) {
         my $authorid = $dbh->selectrow_array("SELECT authorid FROM author 
WHERE name = ?", $_)
            or die "Can't execute statement: $DBI::errstr";

The 'selectrow_array' function returns this error when run:
[EMAIL PROTECTED]:~/popline$ ./pop2sql.pl w
DBI::st=HASH(0x825da0c)->_prepare(...): attribute parameter 'Bedford JM' is not 
a hash ref at /usr/lib/perl5/DBD/mysql.pm line 200, <> line 2.
[EMAIL PROTECTED]:~/popline$ 

I've tried making the variable '\$_' and '\%$_' to no avail. I bet this is an 
easy question for someone who knows what they're doing, but I can't find it.

Thanks for your thoughts and suggestions.

-Kevin Zembower

-----
E. Kevin Zembower
Internet Systems Group manager
Johns Hopkins University
Bloomberg School of Public Health
Center for Communications Programs
111 Market Place, Suite 310
Baltimore, MD  21202
410-659-6139

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to