generate log file with STDERR output
[openface-maja] / p.pl
diff --git a/p.pl b/p.pl
index 9940b2c..caed5e9 100755 (executable)
--- 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;