in reply to amalgamate similar lines

my %h = (); while(<>) { chop; my @fld = split( /\|/ ); my $key = shift @fld . "|" . shift @fld; $h{ $key } &&= $h{ key } . ','; $h{ $key } .= shift @fld; shift @fld and die "Analysis error: too many fields $_\n"; } for my $k ( keys %h ) { print $k . '|' . $h { $k } . "\n"; }

Everything but the troll