In your example you could just use...
if ( $c eq 'd' || $c eq '9' ) {
I needed to know...
if ( "08:30:22" > 10 ) {
I used
if ( unpack('a2',$time) > 10 ) {
Or you could convert the character to ascii...
if ( ord($c) == 100 or orc($c) == 59 ) {