Another small pl/perl patch - Mailing list pgsql-patches

From Greg Sabino Mullane
Subject Another small pl/perl patch
Date
Msg-id e9ed442454f9827f74f08eb9aaee4a99@biglumber.com
Whole thread Raw
Responses Re: Another small pl/perl patch  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Another quick little patch to clean up the docs. If we are going
to provide examples of perl code, no matter how trivial, we might
as well provide well-written perl code. :)

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200510231745
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

Index: plperl.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/plperl.sgml,v
retrieving revision 2.47
diff -c -r2.47 plperl.sgml
*** plperl.sgml 18 Oct 2005 22:53:54 -0000      2.47
- --- plperl.sgml 23 Oct 2005 21:44:00 -0000
***************
*** 554,561 ****
     system operations are not allowed for security reasons:
  <programlisting>
  CREATE FUNCTION badfunc() RETURNS integer AS $$
!     open(TEMP, ">/tmp/badfile");
!     print TEMP "Gotcha!\n";
      return 1;
  $$ LANGUAGE plperl;
  </programlisting>
- --- 554,564 ----
     system operations are not allowed for security reasons:
  <programlisting>
  CREATE FUNCTION badfunc() RETURNS integer AS $$
!     my $tmpfile = "/tmp/badfile";
!     open my $fh, '>', $tmpfile
!         or elog(ERROR, qq{Could not open the file "$tmpfile": $!});
!     print $fh "Testing writing to a file\n";
!     close $fh or elog(ERROR, qq{Could not close the file "$tmpfile": $!});
      return 1;
  $$ LANGUAGE plperl;
  </programlisting>

-----BEGIN PGP SIGNATURE-----

iD8DBQFDXATPvJuQZxSWSsgRAsWQAJ9hKI+mIJmRhUuqC+kVM73P78ZjxACfejgE
ESnpPV0+8hs4DDbXVE60YcE=
=zLS9
-----END PGP SIGNATURE-----



pgsql-patches by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: suggested warning about perl nested named subroutines
Next
From: Mark Kirkwood
Date:
Subject: TODO item - tid <> operator