develooper Front page | perl.perl5.porters | Postings from July 2003

Re: [perl #23165] Code sniplet of bug

Thread Previous
From:
Dave Mitchell
Date:
July 29, 2003 15:08
Subject:
Re: [perl #23165] Code sniplet of bug
Message ID:
20030729220852.GA23517@fdgroup.com
On Tue, Jul 29, 2003 at 09:27:12PM -0000, Donald Sures wrote:
> #!/usr/bin/perl -w
> 
> sub mytest() {
>         my ($msg);
>         $/ = undef;
>         open(DATAFILE, "tmpfile");
>         $msg .= <DATAFILE>;
>         close(DATAFILE);
>         print "---\n" . $msg . "\n---\n";
> }
> 
> open  (FHANDLE, ">tmpfile");
> print FHANDLE "here is some text";
> close FHANDLE;
> 
> for ( my $x=0; $x < 10; $x++ )  {
>         mytest();
> }
> 
> unlink ("tmpfile");

Thanks for the report. I assume (since you didn't explicitly mention it)
that the bug is $msg accumulating duplicate strings.

This has been fixed in the latest development versions of Perl
(patch #17910 by the look of it), which is integrated in the
soon-to-be-released Perl 5.8.1.

Regards,

Dave M.

-- 
That he said that that that that is is is debatable, is debatable.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About