An alternative approach is to use
HTML::TokeParser to extract the 'linked' text from anchors:
#!/usr/bin/perl -w
use strict;
use HTML::TokeParser;
my $p = HTML::TokeParser->new('/tmp/ml_test.html');
while ( my $t = $p->get_tag('a')) {
print $p->get_trimmed_text('/a'), "\n";
}