in reply to My Script is saving a New Line Character as an Unreadable character.

Replace this line
$message_class=shift(@ARGV);
with
$message_class=shift(@ARGV); print(">>$message_class<<\n");
and see what is really in the message class you are getting from the command line.

----
I Go Back to Sleep, Now.

OGB