in reply to behaviour of STDOUT and STDERR
You're Suffering from buffering. Put this before print():
$| = 1; # disable buffering STDOUT
|
---|
In Section
Seekers of Perl Wisdom