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.


In reply to Windows / Linux puzzler by lbrandewie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.