or download this
$kards = -99;
$bad="AKQJT98765432KKKK";
$card='K';
...
$kards = eval "$bad =~ tr/$card//;"; #<====== Note the ; " ; at
+ the end. This seems required.
print "xtr kards = $kards from eval cmd : $xtr\n";
#output: xtr kards = 5 from eval cmd : AKQJT98765432KKKK =~ tr/K//
+;