in reply to Detecting Recursion
Luckely, there's a module on CPAN that can help:
#!/usr/bin/perl use strict; use warnings; use Algorithm::Graphs::TransitiveClosure qw /floyd_warshall/; my $g; while (<DATA>) { my ($from, $to) = split; $g -> {$from} -> {$to} = 1; } floyd_warshall $g; while (my ($key, $value) = each %$g) { print "Recursion for function '$key'\n" if exists $g -> {$key} {$k +ey}; } __DATA__ aaa bbb bbb ccc bbb ddd ccc ddd ddd aaa ddd eee
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Detecting Recursion
by Anonymous Monk on Nov 26, 2002 at 23:38 UTC | |
by Abigail-II (Bishop) on Nov 27, 2002 at 09:41 UTC | |
by Anonymous Monk on Dec 01, 2002 at 22:15 UTC |