1use strict; 2use warnings; 3use IO::Handle; 4 5STDOUT->autoflush(1); 6STDERR->autoflush(1); 7 8my $max = shift || 4; 9for ( 1..$max ) { 10 $_ % 2 11 ? print STDOUT $_ 12 : print STDERR $_; 13} 14