BEGIN { my $tee = new IO::Tee(\*STDOUT, ">logfile"); select($tee); }