#!/usr/bin/perl use strict; use warnings; my $record_type_status; my %record_types = ( 100 => 1 , 200 => 1 , 300 => 1 , 400 => 1 , 500 => 1 ); my $record_type_found = "101"; if ($record_types{$record_type_found}) { $record_type_status = "ok"; } else { $record_type_status = "not ok"; # } print $record_type_found, ": ", $record_type_status, "\n";