We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent353a1cc commita794b99Copy full SHA for a794b99
doc/src/sgml/plperl.sgml
@@ -1,4 +1,4 @@
1
-<!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.66 2007/05/04 14:55:32 adunstan Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.67 2008/01/25 15:28:35 adunstan Exp $ -->
2
3
<chapter id="plperl">
4
<title>PL/Perl - Perl Procedural Language</title>
@@ -150,7 +150,7 @@ $$ LANGUAGE plperl;
150
151
<programlisting>
152
my $arg = shift;
153
- $arg =~ s!\\(\d{3})!chr(oct($1))!ge;
+ $arg =~ s!\\(?:\\|(\d{3}))!$1 ?chr(oct($1)) : "\\"!ge;
154
</programlisting>
155
156
</para>
@@ -161,7 +161,7 @@ $$ LANGUAGE plperl;
161
is how to escape binary data for a return value of type <type>bytea</>:
162
163
164
- $retval =~ s!([^ -~])!sprintf("\\%03o",ord($1))!ge;
+ $retval =~ s!(\\|[^ -~])!sprintf("\\%03o",ord($1))!ge;
165
return $retval;
166
167