Please have a look at this code and let me know what I'm doing wrong that the values of the hash is not getting printed in the function CatchText.
Wait(test,2000,0.96);
sub Wait
{
my ( $tag, $duration,$thresh ) = @_;
my $threshvalue = $thresh || "0.95" ;
my $tmp = {
'Command' => 'Wait',
'Tag' => $tag,
'Duration' => $duration,
'Threshold'=> $threshvalue
};
CatchText($tmp);
}
sub CatchText
{
my ($self,$hash) = @_;
my $str = $hash->{'Threshold'};
print "The command is $str \n";
}
I am getting the output as "The command is "
Thank you