in reply to not working in Win10
Try adding
before the first print. If that works it means that rather than going into autoflush mode on STDOUT it is going into buffering mode. perl normally sets autoflush mode on STDOUT if it thinks it is writing to a terminal, so if this works then for some reason when you start perl it doesnt think STDOUT is connected to a terminal.$| = 1;
In Section
Seekers of Perl Wisdom