use strict;
use HTML::SimpleLinkExtor;
use LWP::Simple;
#usage linkextractor http://www.example.com > output.txt
my $url = shift;
my $content = get ($url);
my $extor = HTML::SimpleLinkExtor->new();
$extor->parse($content);
my @all_links = $extor->links;
foreach my $elem (@all_links) {
print $elem."\n";
}