in reply to Perl and arrays of arrays?


I would attack this with a hash to filter out duplicates:
while(<FH>){ chomp; my @fields = split; my $ip = shift @fields; foreach ( @fields ){ $masterhash{$ip}{$_} = 1; } }
Now the hash will contain an unique IP as key with a hash as value of which the keys are uniqe aliases..
So now just print it out:
for my $ip ( keys %masterhash ){ print "$ip ", join (" ",keys %{$masterhash{$ip}}),"\n"; }
Hope this helps... (not tested)

Go Fish!