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


in reply to Tee Module

Printing to multiple file handles with one request


All is well

Replies are listed 'Best First'.
Re^2: Tee Module
by Ballistic (Initiate) on Mar 15, 2013 at 14:49 UTC
    Thanks!

    Reading this gave me the idea of doing it like this.
    # Open Log File for writting open (LOGFILE, "> logfile.txt") or die ("Unable to open LogFile.\n"); sub dualprint { print "@_"; print LOGFILE "@_"; } sub logprint { print LOGFILE "@_"; }
    And then all print commands are replaced with dualprint, and the input stuff is printed with logprint to a log file only, because it is printed to the screen anyway.

    Thank you so much!