#!/usr/bin/perl use strict; use warnings; my @lines = ; my @result; my %hash = (leaved => ' verlaesst den Raum', entered => ' betritt den Raum'); for my $line(@lines){ chomp $line; my ($time,$action,$nick,$text) = (split /\|/,$line)[0,3,4,7]; my $nice = localtime($time); unless($action eq 'text'){ $text = $nick . $hash{$action}; } push @result, '('.$nice.') '.$text } print $_,"\n" for @result; __DATA__ 1165404989||lobby|entered|christian|Christian|lobby 1165404989||lobby|leaved|christian|Christian|lobby 1165403782||lobby|text|christian|Christian|#404040|xxx 1165403706||lobby|entered|christian|Christian|lobby 1165403706||lobby|leaved|christian|Christian|lobby 1165402923||lobby|entered|christian|Christian|lobby 1165402923||lobby|leaved|christian|Christian|lobby 1165402716||lobby|entered|christian|Christian|lobby 1165402595||lobby|leaved|christian|Christian|lobby 1165402433||lobby|entered|christian|Christian|lobby