The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;
use IO::Handle;

STDOUT->autoflush(1);
STDERR->autoflush(1);

my $max = shift || 4;
for ( 1..$max ) {
    $_ % 2 
        ? print STDOUT $_
        : print STDERR $_;
}