#!/usr/bin/perl use LWP::Simple; use URI::URL; @l=(URI::URL->new($ARGV[0])); while(@l) { $url=shift(@l) and !$sites{$url}++ and $html=get($url) and do{ while($html=~s/(href|src)\s*=\s*['"]((?!javascript|mailto).+?)['"]//) { ($t,$n)=($1,URI::URL->new($2,$url)->abs()); $n->params(undef); $n->query(undef); $n->host() eq $url->host() and ( $t eq 'href'?push(@l,$n):$sites{$n}++ ); } } } print "$_\n" for sort keys %sites;