open my $A, '>', 'out.txt'; print $A - 1 == 0 ? "A\n" : "B\n"; # prints 'B' to STDOUT print STDERR - 1 == 0 ? "A\n" : "B\n"; # prints 'B' to STDERR