open LOG, ">>", "/path/to/logfile" or die; sub logme { print STDERR @_; print LOG @_; } logme "something interesting happened\n";