my @temp = (); open(TEXT, "/home/nikster/supertext") || die "Unable to read from supertext : $!"; while() { if ($_ =~ m/^hallo/ig) { push @text, (split m/[:\[\]]/, $_); } } close (TEXT);