in reply to Re^2: Any hints on how to do this?
in thread Any hints on how to do this?

No need to use an array:
use strict; my ($saved_name, $number) = split /\s/, <DATA>; print "$saved_name\t$number\n"; while (<DATA>) { (my $name, $number) = split /\s+/, $_; if ($saved_name eq $name) { print ' '; } else { print $name; } print "\t$number\n"; $saved_name=$name; } __DATA__ GEORGE 21 GEORGE 45 NICK 12 PETER 27 JIM 18 JIM 87 CHRIS 33
Output:
GEORGE 21 45 NICK 12 PETER 27 JIM 18 87 CHRIS 33

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law