use HTML::LinkExtor; $p = HTML::LinkExtor->new(\&cb, "http://www.perl.com";); sub cb { my($tag, %links) = @_; print FIL "$tag @{[%links]}\n"; } $p->parse_file("index.html");