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
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;
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)
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 $/=
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
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?