my %ports = (  3010 => 3100,  3020 => 3200,  3030 => 3300,  3040 => 3400,  3050 => 3500, ); my $port = "3030"; unless (exists $ports{$port}) {    print "no port\n"; } else {  my $port2 = $ports{$port};  print $port2; }