package LIMS::Local::DevelCycle;
use strict;
use warnings;
use Devel::Cycle;
my $out = '';
sub find {
my $thing = shift;
# skip $ENV{HARNESS_ACTIVE} until perl >5.10 warning fixed:
# "Unhandled type: REGEXP at Devel/Cycle.pm line 107"
# see https://rt.cpan.org/Public/Bug/Display.html?id=56681.
return 0 if $ENV{HARNESS_ACTIVE};
open my $oldout, '>&', STDOUT or die "Can't dup STDOUT: $!";
close STDOUT;
open STDOUT, '>', \$out or die "Can't redirect STDOUT: $!";
find_cycle($thing);
open STDOUT, '>&', $oldout or die "Can't dup \$oldout: $!";
return $out ? "got this: [$out]\n" : 0;
}
# exit 0;
1;