#!/usr/bin/perl -w use strict; use warnings; my %test = ( foo1 => 'a', foo2 => 'b', ); if (exists $test{"foo\d"}) { print "ja\n"; }