[tpm] eval oddness

Shlomi Fish shlomif at iglu.org.il
Thu Dec 10 08:52:22 PST 2009


On Thursday 10 Dec 2009 15:38:48 Dave Doyle wrote:
> I dig that, but since the eval is a runtime construct how would something
> like eval "use Module::Name;" differ from eval "require Module::Name"?  Is
> there any difference in the use of "use" as opposed to "require" in that
> context?

Well, use will also call Module::Name->import().

Regards,

	Shlomi Fish

> 
> --
> dave.s.doyle at gmail.com
> 
> On Wed, Dec 9, 2009 at 11:38 PM, Liam R E Quin <liam at holoweb.net> wrote:
> > On Wed, 2009-12-09 at 22:27 -0500, Dave Doyle wrote:
> > [...]
> >
> > > Though I'm hardpressed to explain why, using "require" instead of
> > > "use" seems to be more canonical when dynamically loading modules.
> >
> > That's because, in general, "use" is compile-time, and "require" is
> > done at run-time.
> >
> > If you don't know what module you want until run-time, or
> > you don't know if a particular module will be needed ,"require"
> > is a good option.
> >
> > Liam
> >
> >
> >
> > --
> > Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
> > Pictures from old books: http://fromoldbooks.org/
> > Ankh: irc.sorcery.net irc.gnome.org www.advogato.org
> 

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap

Bzr is slower than Subversion in combination with Sourceforge. 
( By: http://dazjorz.com/ )


More information about the toronto-pm mailing list