#!/usr/local/bin/perl use strict; use warnings; my %hash; while (){ chomp (my $zeile = $_); $hash{$zeile}++; } for my $wert (keys %hash) { print $wert . " => " . $hash{$wert} . "\n"; } __DATA__ blub blab blib blib blub bleb blfb