#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::LibXML; my $string = q~...~; my $xml = 'XML::LibXML'->load_html(string => $string); say for $xml->findnodes('//a');