From: Dobrica Pavlinusic Date: Sat, 8 Jul 2023 06:49:59 +0000 (+0200) Subject: generate log file with STDERR output X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=0a7f89f16904ebb80d6c3d9771388537c412cda2;p=openface-maja generate log file with STDERR output --- diff --git a/p.pl b/p.pl index 9940b2c..caed5e9 100755 --- a/p.pl +++ b/p.pl @@ -10,6 +10,16 @@ my $filename = 'Intervali_Openface_novi_rad_Boris_export.txt'; my $debug = $ENV{DEBUG} || 0; +my $today = strftime("%Y-%m-%dT%H:%M:%S", localtime(time())); +warn "# today $today"; + +open(my $err_fh, '>', "out.$today.log"); +local $SIG{__WARN__} = sub { + print STDERR @_; + print $err_fh @_; +}; + + sub col2nr { my @c = @_; my $i = 0; @@ -60,9 +70,7 @@ sub glob_id { } } -my $today = strftime("%Y-%m-%dT%H:%M:%S ", localtime(time())); -warn "# today $today"; -open(my $skipped_input, '>',"skip.$today"); +open(my $skipped_input, '>',"out.$today.skip"); open(my $out_fh, '>', "out.$today"); my @out_header;