Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
use base qw{ Ticket }; fixes all the evil things you attempt via "import" and "@ISA".

I also fixed other minor things to make this work:

use strict; use warnings; my $t = new STRTicket(33); # Gave it a ticket ID of 33, to avoid DIE e +rror msg. {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' => [], # NEEDS to be a SCALAR (Arrayre +f) NOT a list. 'AGE' => undef, 'TITLE' => undef, }; bless $self, $class; if ( defined $ticketid) { #--- You had $Ticket here - UNDEFINE +D..... $self->{'TICKETID'} = $ticketid; # and here ...... } 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; } #--- I added Braces to isolate modules #--- deleted unused packages.... { package STRTicket; use base qw[Ticket]; 1; }

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom


In reply to Re: Possibly Stupid OOP question by NetWallah
in thread 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found