use strict; use warnings; use Text::CSV_XS 'csv'; use Data::Dumper; use feature 'say'; my $array_of_hashes = csv( in => '/path/to/file.csv', headers => 'auto'); say Dumper $array_of_hashes; # Now loop through each hash and convert to XML