in reply to How to analyse structured data to get a hash
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; while (<DATA>) { my %hash = /\s*(.*?)="(.*?)"/g; print Dumper \%hash; } =Prints: $VAR1 = { 'value' => '2017-06-03T11:27:23+01:00', 'type' => 't', 'desc' => 'Time file was created.', 'ord' => '3', 'Attr num' => '101', 'name' => 'Created' }; =cut __DATA__ Attr num="101" name="Created" desc="Time file was created." type="t" o +rd="3" value="2017-06-03T11:27:23+01:00"
|
|---|