Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: strange error when subclassing packages

by adrianh (Chancellor)
on Apr 21, 2003 at 09:33 UTC ( #251965=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: strange error when subclassing packages
in thread problem using Class::Factory

use base qw(xxx); is equivalent to require xxx; our @ISA=qw(xxx);.

Although you would be somewhat challanged to discover this from the documentation this isn't entirely true. It isn't exactly equivalent since base explicitly ignores errors from require that indicate the module cannot be loaded. This is handy since it allows you to write things like this:

{ package Foo; # ... some methods ... } { package Bar; use base qw(Foo); };

where no modules are involved at all. Take a look at the source for details.

As Aristotle points out the lack of an import isn't the cause of the problem. Class::Factory works perfectly well with use base (at least on my box :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-06-23 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (121 votes). Check out past polls.

    Notices?