in reply to Reaped: Re^2: print the output on the screen and to a file
in thread print the output on the screen and to a file
If there are many such print statements, then define a function to handle it:
sub my_tee { my $handle = shift; print $handle @_; print @_; } open my $fh, '>>', 'output.txt' or die "$!"; my_tee $fh => ("Greetings!\n"); my_tee $fh => ("Hello", " ", "World");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: print the output on the screen and to a file
by rkshyam (Acolyte) on Mar 31, 2012 at 06:18 UTC |