> From: Renee Backer [mailto:renee.baecker@smart-websolutions.de]
> Dr.Ruud wrote:
> > 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.
> >
> >
>
> B::Deparse says, that there is a do block:
B::Deparse reconstructs using its own guesses based on OP tree, but
basically what it founds is not 100% correct.
More correct using perl -MO=Concise to see an OP tree
>
> rbaecker@test ~/ $ perl -MO=Deparse if.pl
> use warnings;
> use strict 'refs';
> do {
> if (open my $fh, '/etc/passwd') {
> print 'inner';
> }
> };
> system "ls -l /proc/$$/fd";
BR,
Vadim.
Thread Previous
|
Thread Next