stas 2003/08/20 17:19:04 Modified: src/docs/2.0/api/APR PerlIO.pod Log: APR:PerlIO now wants a pool object instead of $r||$s Revision Changes Path 1.4 +11 -4 modperl-docs/src/docs/2.0/api/APR/PerlIO.pod Index: PerlIO.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/APR/PerlIO.pod,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PerlIO.pod 8 Apr 2003 07:39:28 -0000 1.3 +++ PerlIO.pod 21 Aug 2003 00:19:04 -0000 1.4 @@ -4,6 +4,7 @@ =head1 SYNOPSIS + # under mod_perl use APR::PerlIO (); sub handler { @@ -12,13 +13,20 @@ die "This Perl build doesn't support PerlIO layers" unless APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED; - open my $fh, ">:APR", $filename, $r or die $!; + open my $fh, ">:APR", $filename, $r->pool or die $!; # work with $fh as normal $fh close $fh; return Apache::OK; } + # outside mod_perl + % perl -MApache2 -MAPR -MAPR::PerlIO -MAPR::Pool -le \ + 'open my $fh, ">:APR", "/tmp/apr", APR::Pool->new or die "$!"; \ + print $fh "whoah!"; \ + close $fh;' + + =head1 DESCRIPTION C<APR::PerlIO> implements a Perl IO layer using APR's file @@ -55,7 +63,7 @@ To use APR Perl IO to open a file the four arguments open() should be used. For example: - open my $fh, ">:APR", $filename, $r or die $!; + open my $fh, ">:APR", $filename, $r->pool or die $!; where: @@ -64,8 +72,7 @@ mode to open the file under (E<gt>, E<lt>, etc) and the second section must be a string I<APR>. -the fourth argument can be a C<Apache::RequestRec> or -C<Apache::ServerRec> object. +the fourth argument must be an C<APR::Pool> object. the rest of the arguments are the same as described by the I<open()> manpage.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]