develooper Front page | perl.perl5.porters | Postings from July 2002

Re: Thread::Use - use a module inside a thread only

Thread Previous | Thread Next
Jenda Krynicky
July 30, 2002 05:55
Re: Thread::Use - use a module inside a thread only
Message ID:
From: Rafael Garcia-Suarez <>
> Well, "useit Foo" should call import() just like "use Foo" does --
> without any arguments. The parser does some magic to distinguish
> between "use Foo" and "use Foo ()". I think you may provide a
> useit_noimport() subroutine. But in this case a straight require() is
> probably simpler.

The problem with run-time "useit Foo" instead of compile-time "use 
Foo" is that the symbols are not exported while compiling, prototypes 
not "installed", constants not defined, etc. etc. etc.

Would not it be simpler then to require() or do() the whole thread?

	use threads;
	$thread = threads->create(sub {do '';})


=========== == ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
					--- me

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About