#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(autocheck => 1); for ('a' .. 'z') { my $url = "http://wordlist.com/index-$_.htm"; eval { $mech->get($url) }; if ($@) { warn "Unable to get link for letter '$_': $@\n"; next; } for my $link ($mech->links) { my $word = $link->text; next if ! $word || index($word, ' ') == -1; print "$word\n"; } }