Re: Apache::File correction

2002-04-13 Thread Dominic Mitchell
Rob Nagler [EMAIL PROTECTED] writes: undef $/; # enable slurp mode I think the local is pretty important, especially in mod_perl: local $/; This has the same effect (the undef is unnecessary). It's also a good idea to enclose the code in a subroutine with error

Re: Apache::File correction

2002-04-12 Thread Ernest Lergon
Martin Haase-Thomas wrote: [snip] Secondly I wonder whether local $/ = undef will have any effect. But I've never tried overriding Perl's predefined variables. regards Dear Martin, this is the well-known file-slurp mode. E.g.: undef $/; # enable slurp mode $_ = FH;

Re: Apache::File correction

2002-04-12 Thread Rob Nagler
undef $/; # enable slurp mode I think the local is pretty important, especially in mod_perl: local $/; This has the same effect (the undef is unnecessary). It's also a good idea to enclose the code in a subroutine with error checking: sub read_file { my($file)

Apache::File correction

2002-04-10 Thread Rasoul Hajikhani
Folks, The Apache::File man pages indicate that ($name,$fh) = Apache::File-tmpfile; returns a fh ready to write to. So far so good. In case of wanting to read from it, here is what I do: # Is this necessary? $fh-close() or die Could not close $name: $!\n; $fh-open($name); local $/=

Re: Apache::File correction

2002-04-10 Thread Robert Landrum
At 1:44 PM -0700 4/10/02, Rasoul Hajikhani wrote: Folks, The Apache::File man pages indicate that ($name,$fh) = Apache::File-tmpfile; returns a fh ready to write to. So far so good. In case of wanting to read from it, here is what I do: # Is this necessary? $fh-close() or die Could not close

Re: Apache::File correction

2002-04-10 Thread Rasoul Hajikhani
Robert Landrum wrote: At 1:44 PM -0700 4/10/02, Rasoul Hajikhani wrote: Folks, The Apache::File man pages indicate that ($name,$fh) = Apache::File-tmpfile; returns a fh ready to write to. So far so good. In case of wanting to read from it, here is what I do: # Is this necessary?