open FILE, '<', "data.txt" or die $!; my %graph = use Paths::Graph; my $g = Paths::Graph->new(-origin=>"10.0.0.128"=>"10.0.0.138",-graph=>\%graph); my @paths = $g->shortest_path(); for my $path (@paths) { print "Shortest Path:" . join ("->" , @$path) . " Cost:". $g->get_path_cost(@$path) ."\n"; }