sub squote { my $s_pos = pos; my $match = / \G ' (?> (?: \\. | [^\\'] )* ) ' /xsgc; my $e_pos = pos; if ($match) { $_[0] = substr($_, $s_pos, $e_pos-$s_pos); return 1; } else { pos = $s_pos; return 0; } }