in reply to Perl and arrays of arrays?
Now the hash will contain an unique IP as key with a hash as value of which the keys are uniqe aliases..while(<FH>){ chomp; my @fields = split; my $ip = shift @fields; foreach ( @fields ){ $masterhash{$ip}{$_} = 1; } }
Hope this helps... (not tested)for my $ip ( keys %masterhash ){ print "$ip ", join (" ",keys %{$masterhash{$ip}}),"\n"; }
|
---|