[ABE.pm] Inhertance
Ricardo SIGNES
rjbs-perl-abe at lists.manxome.org
Fri Mar 9 10:26:03 PST 2007
* "Faber J. Fedor" <faber at linuxnj.com> [2007-03-09T12:04:50]
>
> I created a directory in /home/faber/libs/report called Benchmark and
> created a file within it called RankReport.pm. The top of RankReport.pm
> looks like:
>
> #!/usr/bin/perl
> package Benchmark::RankReport;
> [ ... ]
>
> I haven't had to do that (prepending the parent class) in the past with CPAN
> modules so I'm wondering if I'm doing it right.
When you say "use X::Y::Z", perl goes through each entry in @INC and looks for
X/Y/Z.pm.
The package that gets defined because of that is based on the "package" line(s)
in Z.pm, but generally it will define "package X::Y::Z"
If that is a class with a new method, you will need to say X::Y::Z->new, not
Z->new.
I think this is what you were talking about, but I'm not sure.
--
rjbs
More information about the ABE-pm
mailing list