in reply to Redirecting perl output on the command line

It's a buffering issue, buffering works different when script has output to the console and when it writes to a file. Try this:
#!/usr/bin/perl -w use strict; $| = 1; print "Begin...\n"; for ( my $i = 0; $i < 5; $i++ ) { print "$i...\n"; sleep 2; }
How do I flush/unbuffer an output filehandle? Why must I do this?