
# Take in list of numbers, one per line, echo list to stdout or stderr.

my $out = $ARGV[0] ? \*STDERR : \*STDOUT;

my $sum;
while (<STDIN>) {
    print $out $_;
    $sum += $_;
}

# Try to break stdio
open(F, ">/dev/null") || die;
select(F);
open(STDIN, '>&F') || die;
open(STDOUT, '>&F') || die;
open(STDERR, '>&F') || die;
