If this means ignoring duplicates use a HashOfHashes (HOH)
poj#!perl use strict; use Data::Dumper; my %hash=(); while (<DATA>){ chomp; my ($name,$ip) = (split)[0,1]; if ( $name ne "" && $ip ne "" ) { ++$hash{$name}{$ip}; } } my %application=(); for my $name (keys %hash){ $application{$name} = [sort keys %{$hash{$name}}]; } print Dumper( \%application ) ; __DATA__ application1 10.10.1 application1 10.10.2 application3 10.10.1 application3 10.10.3 application2 10.10.3 application2 10.10.4 application2 10.10.5 application3 10.10.6 application1 10.10.1 application1 10.10.1
In reply to Re^3: Array of Arrays on Monday.
by poj
in thread Array of Arrays on Monday.
by vlturner
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |