in reply to Why is the valu of the hash not geting printed

Note that you don't have to set up a temporary variable for the call to CatchText, or for the threshold.
... CatchText({Command => 'Wait', Tag => $tag, Duration => $duration, Threshold => $thresh || 0.95, });
You don't have to quote the hash keys either, so long as they are valid perl identifiers.