in reply to Representing a connection matrix of graph

Did you write any own code for this?
use Data::Dumper; my %hash; while (<>) { chomp; my ($what,$where) = split /\s+/,$_; exists $hash{$what} || $hash{$what} = []; push @{$hash{$what}},$where; } print Dumper %hash;
(untested).
See perlreftut for more.
Sorry if my advice was wrong.