in reply to Re^2: Escaping Apostrophe
in thread Escaping Apostrophe
Quick, dirty — and, per other replies, kinda crazy (and also untested):
And BTW: It looks like you're dealing with single-quote characters, not apostrophes.my ($row_sub_i_esc_sq = $row[$idx]) =~ s{ ' }{\\}xmsg; $updstmt .= $hdr[$idx]." = '". $row_sub_i_esc_sq ."' \r\n";
Update: Oops... Meant to write s{ (?= ') }{\\}xmsg; and the substitute-on-assignment expression is also wrong, so finally (I think):
Thanks choroba. Of course, that's what always happens when I post untested stuff.(my $row_sub_i_esc_sq = $row[$idx]) =~ s{ (?= ') }{\\}xmsg; $updstmt .= $hdr[$idx]." = '". $row_sub_i_esc_sq ."' \r\n";
Give a man a fish: <%-{-{-{-<
|
---|
In Section
Seekers of Perl Wisdom