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"; }