It depends on where your prints go. In any case, there's probably some buffering going on (unless your handle is hot). If your output does not go directly to a terminal, that buffering pretty much does the same thing as you are trying to do, with the question of the size of the chuncks already handled. If your output goes to a terminal, then it is flushed every time a \n is encountered and you might benefit from constructing bigger messages. This is a candidate for Benchmarking as shown by vrk.
NB: I tried the following perl -E "for (1..10) { say 'Hello'; sleep(1); }" > test.txt and tail -f text.txt. It confirmed that redirecting STDOUT to a file removes the line buffering mode: even with $| = 0, the "Hello"s are displayed straightaway when printing to the console. IE: I got all the lines at once.
More information on buffering here
In reply to Re: Performance In Perl
by Eily
in thread Performance In Perl
by Mano_Man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |