#!/usr/bin/perl foreach my $i ( 1..3 ) { print "\nChecking something - "; sleep 3; print "OK"; } print "\n";
It prints this line all at once - "Checking something - OK"
Why does it not print "Checking something - " first, and then add "OK" after 3 seconds?
In reply to print inside a loop by nbezzala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |