Leser: 26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/perl use strict; use warnings; use IO::Tee; my $tee_file="stdout.txt"; my $tee=new IO::Tee('>&STDOUT', ">$tee_file"); close(STDOUT); *STDOUT = $tee; print "Test1\n"; print "Test2\n"; print "Test3\n"; print "Test4\n";
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/perl use strict; use warnings; my $logfile='out.log'; open(my $out, '|-', "/usr/bin/tee $logfile") or die("ERROR start tee: $!"); close(STDOUT); *STDOUT=$out; print "Test1\n"; print "Test2\n"; print "Test3\n"; print "Test4\n";
Guest werCode (perl): (dl )1 2 3 4 5 6 7 8 9 10 11 12 13 14 15#!/usr/bin/perl use strict; use warnings; use IO::Tee; my $tee_file="stdout.txt"; my $tee=new IO::Tee('>&STDOUT', ">$tee_file"); close(STDOUT); *STDOUT = $tee; print "Test1\n"; print "Test2\n"; print "Test3\n"; print "Test4\n";
select(STDOUT)
2014-03-13T09:01:30 MuffiDann würd ich schaun, ob ichs vielleicht garnicht erst umsetzen muss.