#!/usr/bin/perl -w use strict; use warnings; my %hash = ( 100 => 'foo', 200 => 'bar', 300 => 'foobar', 400 => 'foofoo', 500 => 'barbar', ); my $test = '300'; my $nr = grep {$_ eq $test} keys %hash; print "Laufende Nr. $nr\n";