#!/usr/bin/perl -w use strict; use warnings; my %test = ( '15.01.2011' => defined, '17.01.2011' => defined, '13.02.2011' => defined, '16.03.2011' => defined, '20.12.2011' => defined, ); foreach my $m (1..12) { if (grep {$_ =~ /\.0?$m\./} keys %test) { print "Monat $m gefunden!\n"; } }