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"; }