On Sat Aug 11 12:29:40 2001, me-01@ton.iguana.be wrote:
>
> -----------------------------------------------------------------
> [Please enter your report here]
>
> Run this from the commandline:
>
> perl -wle 'print $]; sub foo { local (*A, *B); pipe(A,B); return
> fileno(A)}; sub bar { local *BOE; print open(BOE, "<&=" . foo) ?
> "bad" : "good"}; bar; close STDIN; bar'
>
> Tested on two systems this gives:
> 5.007001
> good
> bad
>
> 5.006
> good
> good
>
>
> Written formatted, the code is:
>
> print $];
>
> sub foo {
> local (*A, *B);
> pipe(A,B);
> return fileno(A)
> };
>
> sub bar {
> local *BOE;
> print open(BOE, "<&=" . foo) ? "bad" : "good"
> };
>
> bar;
> close STDIN;
> bar
>
> the filehandles created in foo should be closed when foo is left,
> so bar's attempt to fdopen on the filedescriptor should fail.
>
> It however succeeds from perl 5.7 on for filedescriptors 0, 1 and 2
> because the closes are in fact not done.
>
Persists in Perl 5.14.2:
$ perl -wle 'print $]; sub foo { local (*A, *B); pipe(A,B); return
fileno(A)}; sub bar { local *BOE; print open(BOE, "<&=" . foo) ? "bad" :
"good"}; bar; close STDIN; bar'
5.014002
good
bad
---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=7515
Thread Previous