I have tried this but the fact the Perl script is NOT buffered when ran as a standalone script or when tee/exec is not used within the Bash script suggests to me it's not an issue with the Perl script itself but rather it's interaction with the Bash.
Update 1: I had tried $|=1; however the fact that NO buffering occurs when the Perl script is run as a standalone or when exec/tee is not used within the Bash script, suggests to me that it's not an issue inherent to the Perl but rather a problem with its interaction with Bash.
Update 2: $|=1; now appears to work and solves the issue - i'm not sure why it did not before.
In reply to Re^2: Printing to STDOUT buffered when invoking Perl within a bash-script using tee
by TJCooper
in thread Printing to STDOUT buffered when invoking Perl within a bash-script using tee
by TJCooper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |