#!/usr/bin/perl use warnings; use strict; my @keys = qw(number date author comment); my @revs; { local $/ = ''; while (<>) { my @values = split(/\|/); my %rev; foreach (@keys) { $rev{$_} = shift @values; $rev{$_} =~ s/^\s+|\s+$//g; } push @revs, \%rev; } } if (@revs) { print "\n"; foreach my $rev (@revs) { print " \n"; print " $rev->{number}\n"; print " $rev->{date}\n"; print " $rev->{author}\n"; print " \n"; print " $rev->{comment}\n"; print " \n"; print " \n"; } print "\n"; }