$ PERLIO_DEBUG=/dev/tty ./802517.pl 1 # with explicit close ... ./802517.pl:0 openn(perlio,'(Null)','Iw',1,0,0,(nil),0,(nil)) ./802517.pl:0 Layer 0 is unix ./802517.pl:0 Layer 0 is unix ./802517.pl:0 PerlIO_push f=0x6253c0 unix w 0x603b08 ./802517.pl:0 fd 1 refcnt=1 ./802517.pl:0 PerlIO_push f=0x6253c0 perlio Iw 0x603b08 ./802517.pl:0 Layer 1 is perlio ... ./802517.pl:15 openn(perlio,'','w+',-1,0,0,(nil),1,0x60a178) ./802517.pl:15 Layer 0 is unix ./802517.pl:15 Layer 0 is unix ./802517.pl:15 PerlIO_push f=0x6253c0 unix w+ 0x603b08 ./802517.pl:15 fd 1 refcnt=1 ./802517.pl:15 PerlIO_push f=0x6253c0 perlio w+ 0x603b08