#!/usr/bin/perl use strict; use warnings; open(FILE, "<", "test.txt") or die $!; my %hash = (); while() { chomp $_; if($_ =~ /^(.*)\|(.*)\|$/) { $hash{$1} = $2; } } foreach my $key (keys %hash) { print "Wert an Stelle ".$key." => ". $hash{$key}."\n"; } close FILE;