NeilFawcett
Programmer
What does "$|=1" actually mean/do?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!perl
# Fun (?) with autoflush.
# Without $| > 0, nothing is printed 'til blastoff since
# the prints have no \n.
# See perldoc perlvar.
$| = shift;
print qq(Countdown: );
for (reverse 0..10) {
printf qq(%2d), $_;
sleep 1;
print qq(\b) x 2
}
print qq(\nBlastoff!\n);
#!/usr/bin/perl
$| = 1;
print "Content-type: text/html\n\n";
for (reverse 0..5) {
print "$_<BR>";
sleep 1;
}
print "Done";
exit;
#!/usr/bin/perl
$| = 1;
print "Content-type: text/html\n\n";
for (reverse 0..5) {
print "<div>$_<div>";
sleep 1;
}
print "Done";
exit;