#!/usr/bin/perl
select STDOUT;
$| = 1;
for (my $i = 0; $i < 100000; $i++) {
print "\r$i";
select STDOUT;
$| = 1;
for (my $i = 0; $i < 100000; $i++) {
print "\r$i";
}
print "\n";
提示:$|告诉perl立刻flush buffer
}
print "\n";
提示:$|告诉perl立刻flush buffer