Click to See Complete Forum and Search --> : Help Object related


digital_storm
05-13-2005, 04:51 AM
Hello

I'm new to Perl and I'm trying to make an little webb application using object oriented Perl I get an error that doesn't say to much to me.

The error I get looks like:

Status.pm did not return a true value at cntrl.cgi line 4.
BEGIN failed--compilation aborted at cntrl.cgi line 4.

Because of my little knowledge in Perl I dont know what I do wrong...if anyone could point me in right direction I would be really glad!

----------------------cntrl.cgi----------------------------------------------
#!/usr/bin/perl
use lib "/var/www/cgi-bin";
use CGI;
use Status;
use CGI::Session;
my $query = new CGI;
.
.
my $status=new Status($usr);
.
.
-------------------------------------------------------------------------------

----------------Status.pm--------------------------------------------------
#!/usr/bin/perl
package Status;

use lib "/var/www/cgi-bin";
use CGI;
use CGI::Session;
my $storedred="";
my $storedval="";

#constructor
sub new {
my $currnumber=shift;

my ($class) = @_;
my $self = {
_cfimm=>undef,
_cfimmint=> undef,
_cfimmext=> undef,
_cfnoansw => undef,
_cfnoanswint => undef,
_cfnoanswext => undef,
_cfnoanswtime => undef,
_cfbusy => undef,
_cfbusyint => undef,
_cfbusyext => undef,
_cfunvail => undef,
_cfunvailint => undef,
_cfunvailext => undef,
_shortnr => undef,
_tandem => undef,
};
bless $self, $class;
$self = getState($currnumber);
return $self;
}

-------------------------------------------------------------------------------------


Thanks in advance!

/D_S

Charles
05-13-2005, 07:30 AM
Modules need to return a true value in Perl. We do that by using the following as the last line of the file:1;