![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re: Dynamically printing out iteration number from foreach loopby frozenwithjoy (Priest) |
on Jun 21, 2013 at 21:17 UTC ( #1040223=note: print w/replies, xml ) | Need Help?? |
This is happening because the output is being buffered. You can turn on the auto-flush for the buffer by adding the following somewhere in your script before what you want to be unbuffered: $| = 1;$| = 0; reverts everything back to normal. If you want to get more complicated, you can try IO::Handle, but it is probably overkill for what you need.
In Section
Seekers of Perl Wisdom
|
|