develooper Front page | perl.perl5.porters | Postings from August 2001

Re: Modules that get passed a bareword?

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
August 20, 2001 01:05
Subject:
Re: Modules that get passed a bareword?
Message ID:
20010820075717.1542.1@bactrian.ni-s.u-net.com
Jeff Okamoto <okamoto@xfiles.corp.hp.com> writes:
>Hi all,
>
>I'm slowly working on some IPv6 stuff, and was trying to figure out if
>I can move connect/bind/accept (at least) out of Perl's core and into
>an XSUB module.
>
>My problem at the moment is determining if a bareword filehandle can be
>passed into and out of an XSUB.  I don't mean an filehandle stored in a scalar.

_Anything_ can be passed to an XSUB. In this case a bareword is just a string.
Using the string from XSUB side is a bit of pain as there isn't a clean 
XS side caller() equivalent to find out the package that string should
be considered to live in.


>
>In other words, I'd like to be able to do:
>
>	use Socket6;
>
>	socket(SOCK, .....);		# Calls socket in Perl's core
>	Socket6::connect(SOCK, ...);	# Call the IPV6 connect
>
>I've looked through the modules shipped with the latest devperl, but
>can't seem to find an existing module whose code I can reuse.

Symbol::qualify does the job for perl-level.


>
>If anyone knows of oneon CPAN, or has any suggestions on how to proceed,
>please let me know.
>
>Thanks!
>Jeff
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About