I wrote a simple FTP script that transfers several files to a web server. As a way of indicating to the user that the script is still running and still transferring files, I want to print a period to the screen each time a file has been transferred (sort of a poor man's progress bar).
To do that, I used the following code.
for(@files){
$ftp->put($_) || die("Couldn't put file:$_\n.");
print ".";
}
Yet, when the code runs, instead of printing a period each time a file has been transferred, it waits to print out
all of the periods
all at once after
all of the files have been transferred.
(Not that this should matter, but I'm using ActivePerl on a Windows box.)
Why don't the periods print out one at a time to the screen?