http://www.perlmonks.org?node_id=839973


in reply to writing in 2 handles

I usually use a subroutine similar to this,

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