in reply to Unicode::Map8 problems

A first problem is that you use my($var) = scalar expression instead of my $var= scalar_expression try removing all those extra ()

But the real problem is that I don't think Unicode::Map8 does work the way you think it does. As I am not really familiar with the module I won't give you a solution using it, but I lifted one to convert unicode to latin1 from XML::TiePYX:

sub utf8_to_latin1 { $_[0]=~s{([\xc0-\xc3])(.)}{ my $hi = ord($1); my $lo = ord($2); chr((($hi & 0x03) <<6) | ($lo & 0x3F)) }ge; }