I wrote a program which occassionally calls shell programs which output to STDOUT. I wanted the output from these programs interspersed with the output from my program (which was printing to STDERR). This snippet will do the trick!
# doesnt work ... "&STDOUT" = "&STDERR";
# Assign STDOUT to STDERR
*STDOUT = *STDERR;
# Open STDERR
open STDERR, ">o.txt";
# Print something to STDERR
warn "hi";
# run a subprocess which output to STDOUT
`pgp -h`;
# Print something to STDOUT
print "ho!\n";
# Now ole'! it's all in the same file!