Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re^4: strange error when subclassing packages (not use vs require)

by pfaut (Priest)
on Apr 21, 2003 at 12:50 UTC ( #251984=note: print w/replies, xml ) Need Help??


in reply to Re^4: strange error when subclassing packages (not use vs require)
in thread problem using Class::Factory

The only time it will only look in a single package is using the syntax $foo->Bar::baz() or Foo->Bar::baz(), which will pass a $self of $foo or "Foo", respectively, but invoke the method in the Bar package.

Ok, I see where I had it wrong. Derived::foo() would not find Base::foo() but Derived->foo() would.

You are also wrong about import(); it is the entire point of OO not to have to sully someone else's namespace with your own symbols.

I understand that completely. I was just pointing out that the manner in which the routine was being invoked might not work without the import. Unfortunately, I was wrong. Sorry to muddy the waters.

90% of every Perl application is already written.
dragonchild
  • Comment on Re: Re^4: strange error when subclassing packages (not use vs require)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://251984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-04-12 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?