use HTML::LinkExtor; my $p = HTML::LinkExtor->new(); $p->parse_file("test.html"); my @hrefs = map { {@$_[1..$#$_]}->{href} } $p->links;