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 subroutin
> 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($
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
$
Hi,
maybe I don't exactly understand what you mean. To me it looks like you
want to direct a stream into a file. Perhaps IO::Handle or IO::Scalar
will provide what you need. Secondly I wonder whether "local $/ = undef"
will have any effect. But I've never tried overriding Perl's predefined
va
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:
> >
>
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 "Cou
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 $/