From 42dd14730e38ea8c01d9165b7dba99e4509f79f4 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 21 Jun 2009 13:40:41 -0500 Subject: turn make_path into a method --- lib/Graph/Implicit.pm | 1 + t/100-projecteuler.t | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3