You'll really need to be more specific (provide more data -- the script itself, maybe?).
But if I understand you correctly, You'll need to define a couple of things, to compare against. eg;
in reply to Comparing routing path if it is in agreement to IGP
if $something<0 || -1; die "no route!";
In other words, if there is no answer, that means (as you put it) the interface is disabled.
You'll also probably need to do some comparisons regarding the "hop count", so that you can
monitor the progress of data via your script. Mind you, I'm groping in the dark here. You really need to provide a little more information, for anybody to provide meaningful responses. But I thought I'd at least try. :)
my $perl_version = "5.12.4";