Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: strange error when subclassing packages

by adrianh (Chancellor)
on Apr 21, 2003 at 09:33 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://251965]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found