But if Perl is oblivious to whats happening to STDOUT I'll devise another workaround
Perl is not oblivious to this, you would notice the difference when you note these characteristics:
- When STDOUT is attached to the terminal it'd have a line-buffered-mechanism, so such a filehandle would be flushed automatically when printing a newline character to it, or whenever you read from the terminal.
- When STDOUT is attached to an output file this flushing doesn't take place the same way above, and the program would not write to a file until after it's run throughout or after the buffer has been filled and needed purging (flushing).
- STDERR is always in line-buffered mode.
I found this
useful link just today, I learnt a lot from it, take a look at it :).
Excellence is an Endeavor of Persistence.
Chance Favors a Prepared Mind.