#!/usr/bin/perl use strict; use warnings; use XML::Simple qw(:strict); my $filename = 'greetings.xml'; # full path probably required my $xs = XML::Simple->new( ForceArray => [ 'para' ], KeyAttr => { para => 'lang' }, ); my $doc = $xs->xml_in($filename); binmode STDOUT, ':utf8'; print <<"EOF"; Content-type: text/html; charset=utf-8