mrallen1 has asked for the wisdom of the Perl Monks concerning the following question:
I know that GLOBs are stored as a "stash" which has a special GV "hash" value, but I don't know how I'm supposed to turn that information into a "real" Unix-ish file descriptor.
Basically, I want to put a snippet like this in my Module.pm:
And I want do_funky_xs_thang to be an XSUB that can take an open filehandle and do stuff to it. (The return value will be a big buffer as a scalar value.)sub open_with_fd { my $self = shift; my $fh = shift; my $big_buffer = do_funky_xs_thang($fh); return $big_buffer; }
Any help would be appreciated. Even a code snippet somewhere would be a good starting point.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to pass filehandles from perl to XS?
by tlm (Prior) on Jun 28, 2005 at 03:59 UTC | |
|
Re: How to pass filehandles from perl to XS?
by fmerges (Chaplain) on Jun 28, 2005 at 09:43 UTC |