develooper Front page | perl.perl5.porters | Postings from April 2008

Re: bug in if(open(my $fh,...))

Thread Previous | Thread Next
April 29, 2008 04:59
Re: bug in if(open(my $fh,...))
Message ID:
Matt Sergeant schreef:

> perl -Mstrict -le 'if (1) { if (open(my $fh, q(/etc/passwd))) { print
> "inner"; } } system(qq(ls -l /proc/$$/fd));'
> Shows that the filehandle just isn't closed AT ALL (until program
> exit).

That's another bug. The "if (1) {}" can be optimized away, but should at
least leave a (scoping) block.

Affijn, Ruud

"Gewoon is een tijger."

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About