sub add_edge { my @graph; for ( @_ ) { push @graph, [ @$_ ]; } ...