diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-06-21 13:40:41 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-06-21 13:40:41 -0500 |
commit | 42dd14730e38ea8c01d9165b7dba99e4509f79f4 (patch) | |
tree | 31dda371d62706d47a4ad2530653c1a821a7a3a7 | |
parent | 688444bb15d91cd9ac6e5dd3f1b97ceb70276865 (diff) | |
download | graph-implicit-42dd14730e38ea8c01d9165b7dba99e4509f79f4.tar.gz graph-implicit-42dd14730e38ea8c01d9165b7dba99e4509f79f4.zip |
turn make_path into a method
-rw-r--r-- | lib/Graph/Implicit.pm | 1 | ||||
-rw-r--r-- | t/100-projecteuler.t | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/Graph/Implicit.pm b/lib/Graph/Implicit.pm index 0d63421..c69e17d 100644 --- a/lib/Graph/Implicit.pm +++ b/lib/Graph/Implicit.pm @@ -201,6 +201,7 @@ sub is_bipartite { # misc utility functions sub make_path { + my $self = shift; my ($pred, $end) = @_; my @path; while (defined $end) { diff --git a/t/100-projecteuler.t b/t/100-projecteuler.t index d7caf3d..78153f8 100644 --- a/t/100-projecteuler.t +++ b/t/100-projecteuler.t @@ -18,7 +18,7 @@ my ($paths, $blah) = $graph->dijkstra("0 0"); my @paths; my $bottom_row = @triangle - 1; for my $i (0..$bottom_row) { - push @paths, [Graph::Implicit::make_path($paths, "$bottom_row $i")]; + push @paths, [$graph->make_path($paths, "$bottom_row $i")]; } my @path_values = map { [map { my ($x, $y) = split; $triangle[$x][$y] } @$_] } @paths; |