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

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

Thread Previous | Thread Next
Elizabeth Mattijsen
July 30, 2002 01:23
Re: Thread::Use - use a module inside a thread only
Message ID:
At 10:05 AM 7/30/02 +0200, Rafael Garcia-Suarez wrote:
>>>... (for modules that don't
>>>export lots of symbols into the caller's namespace).
>>If you do some memory benchmarks, you'd be surprised to see how much 
>>memory is used by exported symbols.
>As a mod_perl programmer for a living, I did some benchmarks of these.
>That's right but I don't really know why it's so memory-consuming.

Me neither.  But it is a source of concern to me...

>Thanks for the explanation (and to Arthur too)

You're welcome...

>>>(BTW your module doesn't provide an interface equivalent to
>>>         use Foo ();
>>>         no Bar ();
>>>--that doesn't call import().)
>>Indeed.  Is there a way to find out whether a subroutine is called 
>>without any parameters or with an empty list?  Cause when I can do that, 
>>I can simulate this behaviour as well...
>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 ()".

Yes, and I guess that magic is unavailable for "normal" class methods 
(which is what useit and noit basically are)...

>I think you may provide a useit_noimport() subroutine.
>But in this case a straight require() is probably simpler.

Indeed.  I'll add a note to the documentation for that...  thanks for the 


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