I think you mean if(int(chr(127)) == $types[$t]...to second davis:
use warnings;
use diagnostics;
if(int(chr(127)) == @types[$t])
{
print "BOO!\n";
}
Gives (among other interesting but pointless for this demo):
Scalar value @types[$t] better written as $types[$t] at test.pl line 4 (#2) (W syntax) You've used an array slice (indicated by @) to select a single element of an array. Generally it's better to ask for a scalar value (indicated by $). The difference is that $foo[&bar] always behaves like a scalar, both when assigning to it and when evaluating its argument, while @foo[&bar] behaves like a list when you assign to it, and provides a list context to its subscript, which can do weird things if you're expecting only one subscript.
"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce