open FILE, ">>file.txt" or die "Couldn't open file";
*TEMP = *STDOUT;
*STDOUT = *FILE;
print STDOUT "I go to the file now...\n";
*STDOUT = *TEMP;