#!/usr/bin/perl use strict; use warnings; use Data::Dumper; #open ( F, '<', $file ) || die "Could not open $file. $!"; my %lut; /^(LINK|TEXT):(.*)$/ and push @{$lut{$1}}, $2 while (); die Dumper \%lut; #close F; _ _DATA_ _ #wgongwog LINK:http://www.perl-community.de #1324wgongwog # LINK:http://www.example.com TEXT:there is more than one way to do it LUI:bla #