in reply to SQL Scripts with PERL
It appears that you have a copious extra quotes in your prepare statement. Removing them should help.
Also, you're not checking the return value of your open.
duff