Improve tests
[app-lastmsg.git] / lib / App / Lastmsg.pm
index 07f71db434c4789cceab6035c054527780f5f4ed..40a3e8a4b89d06c692ef0e62da9e4af92400760e 100644 (file)
@@ -65,9 +65,8 @@ sub run {
                        my ($from) = grep { /^from$/i } $msg->header_names;
                        $from = $msg->header_raw($from);
                        if ($ENV{LASTMSG_DEBUG}) {
-                               my $mid = grep { /^message-id$/i } $msg->header_names;
-                               say STDERR 'Processing ', $msg->header_raw('Message-ID'),
-                                 " from $from" if $ENV{LASTMSG_DEBUG};
+                               my ($mid) = grep { /^message-id$/i } $msg->header_names;
+                               say STDERR 'Processing ', $msg->header_raw($mid), " from $from";
                        }
                        $process_message->($msg, $from);
                }
@@ -84,9 +83,9 @@ sub run {
                                @people = (@people, split /,/, $msg->header_raw($hdr));
                        }
                        if ($ENV{LASTMSG_DEBUG}) {
-                               my $mid = grep { /^message-id$/i } $msg->header_names;
+                               my ($mid) = grep { /^message-id$/i } $msg->header_names;
                                say STDERR 'Processing ', $msg->header_raw($mid),
-                                 ' sent to ', join ',', @people if $ENV{LASTMSG_DEBUG};
+                                 ' sent to ', join ',', @people;
                        }
                        $process_message->($msg, @people);
                }
This page took 0.010937 seconds and 4 git commands to generate.