>> A proper fix would be to add an "invisible" block around the if. That >> would slow down all ifs a bit, though. > > I don't think that works either: > > 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). > perl -Mstrict -le '{ if (open(my $fh, q(/etc/passwd))) { print "inner"; } } system(qq(ls -l /proc/$$/fd));' Shows that the filehandle is closed. Should a TODO test be written for this? (Or won't it be fixed because it would slow down all ifs?) Kind regards, BramThread Previous | Thread Next