open STDOUT ">whatever.dat"; # Here comes all the coding close STDOUT;