use XML::Simple; my $filename="file.xml"; my $xml = XMLin($filename); ## produces the output below print Dumper($xml); ## this bit isn't right because the xml isnt in ## an array but I dont know how to reference ## the products and put them into an array my @products = @{$xml->{product}}; foreach my $item (@products) { Print "Department: $item->{department}\n"; Print "Manufacturer: $item->{manufacturer}\n"; } #### $VAR1 = { 'product' => { 'ORANGE MOTO V545' => { 'department' => 'Computing & Phones', 'startdate' => '1900-01-01 00:00:00.0', 'format' => {}, 'manufacturer' => 'ORANGE' }, 'MORPHY RICHARDS 44411' => { 'department' => 'Kitchen & Home', 'startdate' => '1900-01-01 00:00:00.0', 'format' => {}, 'manufacturer' => 'MORPHY RICHARDS' }, };