in reply to Print vs Say with sleep function
It is not even needed to deactivate buffering and change $|, since printing to STDOUT is line buffered (i.e. the buffer is flushed as soon as a newline character is found).$ perl -e 'use v5.10;for (1..10) {print "$_\n"; sleep(1);}' 1 2 3 4 5 6 7 8 9 10
|
|---|