[tpm] eval oddness

Madison Kelly linux at alteeve.com
Thu Dec 10 07:41:48 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

By the way, +1 point for "The Princess Bride" reference. :D

Anywho, I've been re-reading the (sparse) Net::DBus docs and it always 
shows it's constructor using the "super" method. I know that this has to 
do with inheritance, but to be honest, I've never really understood the 
true meaning of this.

Could this be why the docs always show 'use base 
qw(Net::DBus::Object);'? If so, could you (or someone) better explain 
why this might be needed in general? I feel bad admitting that I don't 
really get it, as I think this is something relatively basic, but there 
you go. :)

Madi



More information about the toronto-pm mailing list