diff options
author | Eric Wong <e@yhbt.net> | 2020-04-18 03:38:50 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-04-19 08:51:24 +0000 |
commit | a479b45117ed69d9311770fa39e6676d38f9cab2 (patch) | |
tree | 9262dbdd0147b02a7d9d9a797271ec25e8aa1c5f /script/public-inbox-mda | |
parent | a014723b600e35cd495f048c89611e611436a15e (diff) | |
download | public-inbox-a479b45117ed69d9311770fa39e6676d38f9cab2.tar.gz |
I did not know to use the return value of `do' back in the day. There's probably no practical difference in these cases, but `eval' is overkill for these uses and may hide actual errors. We can get rid of a few redundant `scalar' ops and pass scalar refs to Email::MIME->new to avoid copies in a few more places, too.
Diffstat (limited to 'script/public-inbox-mda')
-rwxr-xr-x | script/public-inbox-mda | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/script/public-inbox-mda b/script/public-inbox-mda index f37c7492..54d0af01 100755 --- a/script/public-inbox-mda +++ b/script/public-inbox-mda @@ -29,7 +29,7 @@ use PublicInbox::Spamcheck; # in case there's bugs in our code or user error. my $emergency = $ENV{PI_EMERGENCY} || "$ENV{HOME}/.public-inbox/emergency/"; $ems = PublicInbox::Emergency->new($emergency); -my $str = eval { local $/; <STDIN> }; +my $str = do { local $/; <STDIN> }; $str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s; $ems->prepare(\$str); my $simple = Email::Simple->new(\$str); |