my $loopCnt=0;
my %prevsidstat=%{getSessStat()};
while (1) {
debug("Sleeping for $ENV{SESSNAP_INTRVL}...\n");
sleep $ENV{SESSNAP_INTRVL};
my %cursidstat=%{getSessStat()};
if ((keys %cursidstat) != 0 ) {
my $ComResult={sidStatComp(%prevsidstat,%cursidstat)};
my %prevsidstat=%cursidstat;
}
last;
}
Here I am getting hash reference when %{getSessStat()} is executed. Now I want to pass two hash references to sub to process them further, however just printing them in sub getting following error. Appreciate in advance for help.
Odd number of elements in anonymous hash at line 65, <SQLPLUS> line 20.
Sub code:
#*****************************************************
sub sidStatComp {
#*****************************************************
my (%prevsidstat,%cursidstat)=@_;
print "Previous\n";
for my $instsid (keys %prevsidstat) {
print "$instsid => $prevsidstat{$instsid}{SQLEXECINFO}\n";
}
print "Current\n";
for my $instsid1 (keys %cursidstat) {
print "$instsid1 => $cursidstat{$instsid1}{SQLEXECINFO}\n";
}
return 1;
}