lbrandewie has asked for the wisdom of the Perl Monks concerning the following question:
Hey Monks,
I've got a puzzler. I moved an app from Windows to Linux (CentOS 8 to be specific) to solve library problems. I've got a section of code that tries to determine if an email should be sent. The code looks like this:
if ($out eq "D") { # not responding to pings if ($lastmailed{"$email|$targ"} <= ($min - $squelch)) { $mailer = psMailer->new(); $mailer->to($email); $mailer->from($emailfrom); $mailer->subject($emailsubject); $mailer->body("Asset $targ is not responding to pings."); $mailer->assetname($targ); $mailer->send(); } }
psMailer is a simple sendmail interface. That's not the problem. The $min var is calculated as int(time() / 60), so it should always be an int. The $squelch value comes from a settings file. If it is set to 10, the intent is that 10 minutes should pass between emails on a given topic.
This works in Windows, but in Linux the consistent result is that eleven minutes pass between the emails.
I don't get it. Do you have any ideas? TIA,
Lars
p.s. The perl version on CentOS 8 is 5.26.3. The version I was running in Windows was 5.28.1 (Activestate). I'm on Windows 7 x64.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Windows / Linux puzzler
by Veltro (Hermit) on Mar 23, 2020 at 12:34 UTC | |
by lbrandewie (Acolyte) on Mar 23, 2020 at 20:32 UTC | |
by syphilis (Archbishop) on Mar 23, 2020 at 22:47 UTC | |
by ikegami (Patriarch) on Mar 25, 2020 at 18:45 UTC | |
by syphilis (Archbishop) on Mar 26, 2020 at 02:25 UTC | |
| |
by lbrandewie (Acolyte) on Mar 24, 2020 at 06:42 UTC | |
by syphilis (Archbishop) on Mar 24, 2020 at 08:54 UTC | |
|
Re: Windows / Linux puzzler
by Anonymous Monk on Mar 23, 2020 at 02:09 UTC | |
by lbrandewie (Acolyte) on Mar 23, 2020 at 02:39 UTC | |
by haukex (Archbishop) on Mar 23, 2020 at 07:48 UTC | |
by jcb (Parson) on Mar 23, 2020 at 21:57 UTC | |
by lbrandewie (Acolyte) on Mar 23, 2020 at 20:29 UTC | |
by lbrandewie (Acolyte) on Mar 24, 2020 at 06:44 UTC | |
by swl (Prior) on Mar 24, 2020 at 07:10 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |