$h{'abc'} = sub { # # some sort of magic currently unknown to me # }; my $val = 'abc'; if ( $val eq $h{$val} ) { print "that works!",$/ }