in reply to I get "not a HASH reference" when parsing an XML file
Hi,
Try changing
if (exists $main_target->{target}->{sub_target}) [download]
if (exists $main_target->{$target}->{sub_target}) # ^ [download]
Hope this helps!