Now you're including way too much code to wade through. If you reduce the code to just the relevant parts, you'll probably find the error. Nonetheless, tracing it back I think I may have found it.
10:30:00 - Last user sync at
That seems to imply that at that line, $last_user_sync is empty or undef. Tracing back where you got that, I see that ulimately the $ENV{"ORACLE_HOME"} variable is being relied on. Is that set inside your cron job?

As an aside, preview your code. You'll notice that you don't need the <br> at the end of every line, and it makes it much harder to read.

If that doesn't do it, then please cut out all unnecessary crap from your code and repost it. Just a tiny script that does nothing more than fill and print the variable.


In reply to Re: Running a perl script from cron by Eimi Metamorphoumai
in thread Running a perl script from cron by nbierman

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.