Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

If I have an SV that contains a file handle reference, how exactly am I supposed to deal with it? I mean, how can I write or read from it within XSUBs?

Replies are listed 'Best First'.
Re: File handle references from XS?
by Zaxo (Archbishop) on Dec 18, 2004 at 04:57 UTC

    See sv_gets() in perlapi. Quoted,

    sv_gets Get a line from the filehandle and store it into the SV, optionally appending to the currently- stored string. char* sv_gets(SV* sv, PerlIO* fp, I32 append)

    After Compline,
    Zaxo