File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- <!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.66 2007/05/04 14:55:32 adunstan Exp $ -->
1+ <!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.67 2008/01/25 15:28:35 adunstan Exp $ -->
22
33 <chapter id="plperl">
44 <title>PL/Perl - Perl Procedural Language</title>
@@ -150,7 +150,7 @@ $$ LANGUAGE plperl;
150150
151151<programlisting>
152152 my $arg = shift;
153- $arg =~ s!\\(\ d{3})! chr(oct($1))!ge;
153+ $arg =~ s!\\(?:\\|(\ d{3}))!$1 ? chr(oct($1)) : "\\" !ge;
154154</programlisting>
155155
156156 </para>
@@ -161,7 +161,7 @@ $$ LANGUAGE plperl;
161161 is how to escape binary data for a return value of type <type>bytea</>:
162162
163163<programlisting>
164- $retval =~ s!([^ -~])!sprintf("\\%03o",ord($1))!ge;
164+ $retval =~ s!(\\| [^ -~])!sprintf("\\%03o",ord($1))!ge;
165165 return $retval;
166166</programlisting>
167167
You can’t perform that action at this time.
0 commit comments