It doesn't look like XML to me.
It does to me, unless you're not showing everything.
If not, I guess a RegEx would be the way to go.
No, please don't!! Parsing HTML/XML with Regular Expressions
use warnings; use strict; use XML::LibXML; my $xml = <<'END_XML'; <root> <result_summary total_records="594" total_pages="3" current_page="1" records_this_page="250" download_key="xmxnxnxnxnxnxnxnxnx" time_start="2020-02-19 15:50:55" feed_version="1.44" /> </root> END_XML my $dom = XML::LibXML->load_xml(string => $xml); my @nodes = $dom->findnodes('//result_summary'); die "Failed to find exactly one result_summary node" unless @nodes==1; my %attrs = %{ $nodes[0] }; use Data::Dumper; print Dumper(\%attrs); __END__ $VAR1 = { 'total_records' => '594', 'feed_version' => '1.44', 'time_start' => '2020-02-19 15:50:55', 'download_key' => 'xmxnxnxnxnxnxnxnxnx', 'total_pages' => '3', 'records_this_page' => '250', 'current_page' => '1' };
In reply to Re: Get data from an XML file heading
by haukex
in thread Get data from an XML file heading
by nachtmsk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |