Is this what you are after?
use strict; use warnings; use Test::More tests => 1; my $have = "This sting it's bothering to escape ' single characters"; my $want = "This sting it\\'s bothering to escape \\' single character +s"; $have =~ s/'/\\'/g; is $have, $want;
In reply to Re: How to escape single quote(s) without the use of quotemeta
by hippo
in thread How to escape single quote(s) without the use of quotemeta
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |