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

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

Thread Previous | Thread Next
From:
Elizabeth Mattijsen
Date:
July 30, 2002 06:25
Subject:
Re: Thread::Use - use a module inside a thread only
Message ID:
4.2.0.58.20020730151706.02dfdce0@mickey.dijkmat.nl
At 02:54 PM 7/30/02 +0200, Jenda Krynicky wrote:
>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.

Well, I guess YMMV...  prototypes aren't much use in an OO environment 
anyway, exports seems to work fine, judging from the testing that I 
did.  Constants may be another problem, let me check up on that...


>Would not it be simpler then to require() or do() the whole thread?
>         use threads;
>         $thread = threads->create(sub {do 'worker_thread.pl';})
>         ...

Simpler by having to have a different file?  That doesn't make it simpler 
for me...  ;-)


Liz


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