#! /usr/bin/perl use strict; use warnings; my %data; while ( my $line = ) { chomp $line; my ( $id, $date, $value ) = split /;\s+/, $line; # store first occurence of $value with the data $data{$value} = $date if !exists $data{$value}; } # kontrolle use Data::Dumper; print Dumper \%data; __DATA__ ID; Datum; VeränderbareWerte 01; 2011-01-01; abc 02; 2011-01-01; jkl 01; 2011-01-02; abc 01; 2011-01-03; xyz