use MIME::Words (); sub encode_words {   my $value = shift;   return ($value ? MIME::Words::encode_mimewords($value) : ""); } print encode_words("test_mit_3_Anhängen");