This should do what you want...
Here's the explanation:use strict; my %data = (); while (<DATA>) { chomp; my ($col1, $col2) = split /\s+/; $data{$col1} .= "$col2 "; } print "$_: $data{$_}\n" foreach (sort keys %data); __DATA__ text1 text-a text2 text-b text3 text-c text1 text-d text3 text-e text3 text-f
In reply to Re: Removing redundancy
by The Mad Hatter
in thread Removing redundancy
by dr_jgbn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |