#perl use warnings; use strict; my %hash = ( foo1 => 'test', foo2 => 'test2', ); foreach my $k ( grep {$_ =~ /^foo(\d+)$/} keys %hash ) { # Hier hätte ich gern Zugriff auf $1 im Schleifenkopf # Geht das? }