My brain was a little screwy at the moment, so replace line 7 of the flat text file client code (print( $msgs, ($_ . "\n") );) with print $msgs $_ . "\n";. Besides that, I tested out the flat text file. The file locking works good, I'm just wondering if it will be fine with multiple clients at the same moment.
If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.