The following code tells me that no new sub can be found in package STRTicket. While true technically... the @ISA is supposed to enable inheritance... I thought. In this case the empty sub class fails.

All classes are in the same monolithic source file. USE doesn't appear to like that and searches for actual .pm files... so I used import which seems to give me the symboltables (Ticket->new works for instance... but inheritance appears to fail ( Empty sub-class test fails). So What... if anything else am I supposed to do when everything is in a single file to use an object and its subclasses?

my $t = new STRTicket(); package Ticket; sub new { my $class = shift; my $ticketid = shift; my $self= { 'TICKETID' => undef, 'SOURCE' => undef, 'CREATEDBY' => undef, 'OWNER' => undef, 'MODIFIEDBY'=> undef, 'CREATEDON' => undef, 'MODIFIEDON'=> undef, 'COMPANYNAME'=> undef, 'STATE' => undef, 'STATUS' => undef, 'BZTICKETS' => (), 'AGE' => undef, 'TITLE' => undef, }; bless $self, $class; if ( defined $ticket) { $self->{'TICKETID'} = $ticket; } else { die "Ticket object instantiated without a ticket id! This shou +ld never happen.\n"; } return $self; } sub load_bztickets($){ my $self= shift; my $dbh = shift; # pass in the database reference for Bugzilla } 1; package BZTicket; import Ticket; # use Ticket; @ISA = ('Ticket'); 1; package CRMTicket; import Ticket; #use Ticket; @ISA = ('Ticket'); 1; package STRTicket; import Ticket; # use Ticket; @ISA = ('Ticket'); 1;

In reply to Possibly Stupid OOP question by talwyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.