[tpm] eval oddness

Madison Kelly linux at alteeve.com
Wed Dec 9 19:50:56 PST 2009


Dave Doyle wrote:
> I do not think that means what you think that means. :)
> 
> Can I ask why you're doing "use base qw(Net::DBus::Object);" as opposed 
> to "use Net::DBus::Object;" ?  The 'use base' is nonsensical in this 
> context as it's modifying the @ISA array.  It's essentially saying "This 
> class is a subclass of Net::DBus::Object" and not actually making any 
> part of Net::DBus::Object available to you.  I suspect just doing use 
> Net::DBus::Object and you'll be fine.
> 
> Though I'm hardpressed to explain why, using "require" instead of "use" 
> seems to be more canonical when dynamically loading modules.  I'm sure 
> someone far smarter than I on this list could explain that.  I suspect 
> it's the difference between bareword and string (bareword loads a 
> module, string loads the filename specifically instead of searching %INC 
> for it).  There's also import voodoo that won't happen (unless you do 
> the voodoo yourself) but if you're only loading OO modules this 
> shouldn't be a big deal.
> 
> D

Hrm, I guess that would explain it. However, I remember reading at some 
point in the Net::DBus docs that 'use base' was needed... I'll look into 
that more, thanks for the pointer!!

Madi


More information about the toronto-pm mailing list