File tree 1 file changed +3
-3
lines changed
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 $ -->
2
2
3
3
<chapter id="plperl">
4
4
<title>PL/Perl - Perl Procedural Language</title>
@@ -150,7 +150,7 @@ $$ LANGUAGE plperl;
150
150
151
151
<programlisting>
152
152
my $arg = shift;
153
- $arg =~ s!\\(\ d{3})! chr(oct($1))!ge;
153
+ $arg =~ s!\\(?:\\|(\ d{3}))!$1 ? chr(oct($1)) : "\\" !ge;
154
154
</programlisting>
155
155
156
156
</para>
@@ -161,7 +161,7 @@ $$ LANGUAGE plperl;
161
161
is how to escape binary data for a return value of type <type>bytea</>:
162
162
163
163
<programlisting>
164
- $retval =~ s!([^ -~])!sprintf("\\%03o",ord($1))!ge;
164
+ $retval =~ s!(\\| [^ -~])!sprintf("\\%03o",ord($1))!ge;
165
165
return $retval;
166
166
</programlisting>
167
167
You can’t perform that action at this time.
0 commit comments