Something like this?
use WWW::Mechanize;
use strict;
my $m = WWW::Mechanize->new();
$m->get("http://SERVER/PATH");
for my $link ($m->links) {
#next unless GOOD_LINK_CONDITION;
print $link->url."\n";
}
Obviously you need to replace SERVER, PATH, and GOOD_LINK_CONDITION.
Uncomment the 'next' line to do filtering of your links.
-David