use strictures; use WWW::Mechanize; use Encode; my $mech = WWW::Mechanize->new( autocheck => undef ); my $start = shift || die "Give a URL!\n"; $mech->get($start); $mech->success or die "Sorry, sucker!\n", $mech->response->as_string; for my $link ( $mech->find_all_links ) { printf "Link\n * text -> %s\n * URI -> %s\n", encode("UTF-8", $link->text) || "na", $link->url_abs; }