in reply to how to ignore ' in an array

Well, your immediate problem is because you're only removing the first apostrophe from the string. You need to use the /g operator on the substitution operator.

But, like Joost says, the real solution is to use the DBI quote method or placeholders.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg