There's a number of problems in your code. First off, as has already been pointed out, you need to set @ISA to establish inheritence, either directly or with 'use base'. Second - this isn't valid Perl syntax:
sub new : AGENT::new
I don't know what you thought that would do, but I doubt it's going to help! Finally, this won't work in most cases:
$tools->SUPER::Callme();
In Perl, SUPER only works inside the sub-class's package. It looks like it should be evaluating $tool's @ISA but in fact it's evaluating @__PACKAGE__::ISA. In most cases this is what you want since you don't usually allow clients to skip up the inheritence tree, but in your example that would appear to be the case.
I suggest you slow down and pick up a good book on object-oriented Perl - "Programming Perl" or "Object Oriented Perl" are both good. You need to learn the basics before you start free-stylin'.
-sam
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.