The problem is that Perl will not dereference
DBI::db=HASH(0x40b8a38) to the original reference; the equals it is complaining about is the one after the letters
db. You can replicate this with:
package PACK;
sub func {
print "1\n";
}
package main;
$obj = bless {}, 'PACK';
$obj->func;
$str = "$obj->func;1";
eval $str or print $@;
This sounds a lot like an XY Problem. Why are you trying to do a string eval, instead of just the code
$dbh->do("CREATE TABLE STAIP08FK (PROBKEY varchar(20),MOBPAITS varchar
+(15),SOLVER varchar(10),UNKNOWNS char(11),CONSTRAINTS char(11),OBJECT
+IVE char(11),MODEL char(16),CRITERIA char(11),ITERATIONS integer,prim
+ary key (PROBKEY) );"
If there's a reason to do a string eval, why aren't you escaping the dollar sigil in your original string,
e.g.
$str = qq{\$dbh->do("CREATE TABLE STAIP08FK (PROBKEY varchar(20),MOBPA
+ITS varchar(15),SOLVER varchar(10),UNKNOWNS char(11),CONSTRAINTS char
+(11),OBJECTIVE char(11),MODEL char(16),CRITERIA char(11),ITERATIONS i
+nteger,primary key (PROBKEY) );"};
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.