On Aug 24, 2000 at 23:15:15 -0500, Ken Williams twiddled the keys to say:
> [EMAIL PROTECTED] (Rick Myers) wrote:
> >On Aug 24, 2000 at 01:15:57 -0500, Ken Williams twiddled the keys to say:
> >> The following patch eliminates a warning during 'make test' about 'Value
> >> of <HANDLE> construct can be "0";'. No biggie, but it should be fixed.
> >>
> >> ________________________________________________________________
> >> --- t/modules/request.t 2000/05/12 03:43:24 1.8
> >> +++ t/modules/request.t 2000/08/24 06:07:40
> >> @@ -125,7 +125,7 @@
> >> my $lines = 0;
> >> local *FH;
> >> open FH, $file or die "open $file $!";
> >> - ++$lines while (my $dummy = <FH>);
> >> + ++$lines while <FH>;
> >> close FH;
> >> my(@headers);
> >> if ($Is_dougm) {
> >> ________________________________________________________________
> >
> >This reverses a previous patch that fixes a fatal 'Modification of a
> >read-only value attempted at modules/request.t line 128', which returns
> >with this patch.
> >
> >See if this one finds us a happy median...
> >
> >--- t/modules/request.t~ Thu Aug 24 18:24:39 2000
> >+++ t/modules/request.t Thu Aug 24 18:41:22 2000
> >@@ -125,7 +125,7 @@
> > my $lines = 0;
> > local *FH;
> > open FH, $file or die "open $file $!";
> >- ++$lines while (my $dummy = <FH>);
> >+ ++$lines while defined <FH>;
> > close FH;
> > my(@headers);
> > if ($Is_dougm) {
>
>
> THAT's weird - what in the world is the read-only value that's being
> modified?
It's $_.
Here's the relevant code from request.t to illustrate...
for ( qw(perlfunc.pod perlpod.pod perlxs.pod), @binary) {
upload_test($_);
}
sub upload_test {
++$lines while <FH>;
}
The hint is that `while <FH>' will try to set $_ to the value of each
line read.
Rick Myers [EMAIL PROTECTED]
----------------------------------------------------
The Feynman Problem 1) Write down the problem.
Solving Algorithm 2) Think real hard.
3) Write down the answer.