about summary refs log tree commit homepage
path: root/script/public-inbox-learn
diff options
context:
space:
mode:
Diffstat (limited to 'script/public-inbox-learn')
-rwxr-xr-xscript/public-inbox-learn3
1 files changed, 1 insertions, 2 deletions
diff --git a/script/public-inbox-learn b/script/public-inbox-learn
index 9352c8ff..1731a4ba 100755
--- a/script/public-inbox-learn
+++ b/script/public-inbox-learn
@@ -39,8 +39,7 @@ my $spamc = PublicInbox::Spamcheck::Spamc->new;
 my $pi_cfg = PublicInbox::Config->new;
 my $err;
 my $mime = PublicInbox::Eml->new(do{
-        local $/;
-        my $data = <STDIN>;
+        defined(my $data = do { local $/; <STDIN> }) or die "read STDIN: $!\n";
         $data =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
 
         if ($train ne 'rm') {