stas        2004/07/04 10:09:26

  Modified:    src/docs/2.0/user/porting compat.pod
  Log:
  - document the removed Apache::File->new()
  - add the new idiom to slurp the contents of the file
  
  Revision  Changes    Path
  1.52      +19 -3     modperl-docs/src/docs/2.0/user/porting/compat.pod
  
  Index: compat.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/porting/compat.pod,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -u -r1.51 -r1.52
  --- compat.pod        2 Jul 2004 23:17:53 -0000       1.51
  +++ compat.pod        4 Jul 2004 17:09:26 -0000       1.52
  @@ -1185,11 +1185,27 @@
   The methods from mod_perl 1.0's module C<Apache::File> have been
   either moved to other packages or removed.
   
  -=head2 C<open()> and C<close()>
   
  -The methods C<open()> and C<close()> were removed. See the back
  -compatibility implementation in the module
  +=head2 C<new()>, C<open()> and C<close()>
  +
  +The methods C<new()>, C<open()> and C<close()> were removed. See the
  +back compatibility implementation in the module
   C<L<Apache::compat|docs::2.0::api::Apache::compat>>.
  +
  +Because of that some of the idioms have changes too. If previously you
  +were writing:
  +
  +    my $fh = Apache::File->new($r->filename)
  +        or return Apache::DECLINED;
  +    # Slurp the file (hopefully it's not too big).
  +    my $content = do { local $/; <$fh> };
  +    close $fh;
  +
  +Now, you would write that as:
  +
  +  use Apache::RequestUtil ();
  +  $content = $r->slurp_filename();
  +
   
   =head2 C<tmpfile()>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to