Hi all,
Please help me to find the problem.
I have docTopGens class:
package docTopGens;
use wt_w;
sub new
{
my($self) = {};
my($type, @array) = @_;
my $self->{'topGenArray'} = \@array;
my $temp = ref($self->{'topGenArray'});
bless($self, $type);
return($self);
}
here $temp = 'ARRAY';
the problem is that in the following method '$self->{'topGenArray'}' contains nothing and $temp ="";
sub get_wt
{
my $doc_g = $_[1];
my $TopGenArray = $self->{'topGenArray'};
my $temp = ref($self->{'topGenArray'});
my $size = @{$TopGenArray};
for($i=0; $i<$size; $i++)
{
$wt_w = $topGenArray->[$i];
$id = $wt_w->getDocID();
if($doc_g eq $id)
{
return $wt_w->getPG_D();
}
}
return 0;
}
the question is how can I access '$self->{'topGenArray'}'
at 'get_wt' function.
Thanks!
Please help me to find the problem.
I have docTopGens class:
package docTopGens;
use wt_w;
sub new
{
my($self) = {};
my($type, @array) = @_;
my $self->{'topGenArray'} = \@array;
my $temp = ref($self->{'topGenArray'});
bless($self, $type);
return($self);
}
here $temp = 'ARRAY';
the problem is that in the following method '$self->{'topGenArray'}' contains nothing and $temp ="";
sub get_wt
{
my $doc_g = $_[1];
my $TopGenArray = $self->{'topGenArray'};
my $temp = ref($self->{'topGenArray'});
my $size = @{$TopGenArray};
for($i=0; $i<$size; $i++)
{
$wt_w = $topGenArray->[$i];
$id = $wt_w->getDocID();
if($doc_g eq $id)
{
return $wt_w->getPG_D();
}
}
return 0;
}
the question is how can I access '$self->{'topGenArray'}'
at 'get_wt' function.
Thanks!