fixes all the evil things you attempt via "import" and "@ISA".
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;
}