- or download this
PerlIOBase_read(pTHX_ PerlIO *f, void *vbuf, Size_t count)
{
...
return 0;
}
...
- or download this
#!/usr/bin/perl
...
PerlIO_modestr(f, buf);
fprintf(stderr, "mode = %s\n", buf);
}
- or download this
$ ./802590.pl 0
mode = w
$ ./802590.pl 1 # with explicit close
mode = r+
- or download this
$ PERLIO_DEBUG=/dev/tty ./802517.pl 1 # with explicit close
...
...
./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
- or download this
$ PERLIO_DEBUG=/dev/tty ./802517.pl 0
...
...
./802517.pl:15 fd 8 refcnt=0
./802517.pl:15 PerlIO_pop f=0x6253e8 perlio
./802517.pl:15 PerlIO_pop f=0x6253e8 unix