#!/usr/bin/perl use strict; use warnings; my $file = 'logdatei.txt'; my %hash; { # wenn die Datensaetze durch leerzeile getrennt sind local $/ = "\n\n"; open my $fh, '<', $file or die $!; while( my $entry = <$fh> ){ my ($date) = $entry =~ /(\d{4}-\d\d-\d\d)/; next unless $date; $hash{$date}++; } close $fh; } for my $key ( keys %hash ){ print "$key: ",$hash{$key},"\n"; }