#!/usr/local/bin/perl -- use strict; use warnings; use WWW::Mechanize 1.72; Main( @ARGV ); exit( 0 ); sub Main { my $search = shift; my $mech = WWW::Mechanize->new( qw/ autocheck 1 show_progress 1 /); $mech->get( $search ); my @serverLinks = $mech->find_all_links( url_regex => qr/_css/i ); for my $link( @serverLinks ) { for my $member ( qw/ url text name tag / ){ no warnings 'uninitialized'; print $link->$member, "\n" ; } } } __END__ $ perl dumplinks http://nowhere.example.com ** GET http://nowhere.example.com ==> 500 Can't connect to nowhere.example.com:80 (Bad hostname) (1s) Error GETing http://nowhere.example.com: Can't connect to nowhere.example.com:80 (Bad hostname) at dumplinks line 15. $ perl dumplinks http://example.com ** GET http://example.com ==> 302 Found ** GET http://www.iana.org/domains/example/ ==> 200 OK /_css/2008.1/reset-fonts-grids.css link /_css/2008.1/screen.css link /_css/2008.1/print.css link