in reply to STDIN behaves different according to context

This problem again, eh? It's just an OS-specific 'feature'. No, it's not a bug, it's just the behaviour of some OSes. Simply change your code to print a newline after the output:

#!/usr/bin/perl $a = <STDIN>; print $a, "\n";


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, reply to this node or /msg me to tell me what is wrong with the post, so that I may update the node to the best of my ability. If you do not inform me as to why the post deserved a downvote, your vote does not have any significance and will be disregarded.