my %edgeHash; my @alreadySeen; my %countHash; while(){ # Reading data from the inet generator, # making sure the format is correct. if(/^\s*([0-9]+)\s+([0-9]+)\S*$/){ my $a = "$1"; my $b = "$2"; push @{$edgeHash{$a}}, $b if not $alreadySeen[int($b)]++; } }