in reply to Replacing single quotes to two single quotes inside map

If you're using placeholders (and I guess you are, ('?') seems familiar), then you shouldn't need to replace the single quote.
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use DBI; my $db = 'DBI'->connect('dbi:SQLite:dbname=:memory:', "", ""); $db->do('CREATE TABLE t1 (name VARCHAR)'); my $insert = $db->prepare('INSERT INTO t1 VALUES (?)'); $insert->execute("Maria's"); my $select = $db->prepare('SELECT * FROM t1'); $select->execute; while (my @row = $select->fetchrow_array) { say "@row"; # Maria's }

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Replacing single quotes to two single quotes inside map
by Anonymous Monk on Nov 13, 2017 at 14:16 UTC
    Yes, I know that, but I am calling a store procedure that is a DB2 database.
Re^2: Replacing single quotes to two single quotes inside map
by Anonymous Monk on Nov 14, 2017 at 13:45 UTC
    Wouldn't work with smart quote, single quote from MS Word.
      Ah, so they're storing the smart quote as two single quotes in the DB! Clever.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,