Please wrap your code in <code> tags. Have a look at The Perl Monks Guide to the Monastery and How do I post a question effectively?

However, I do see a couple of things: The or die $! should be on the opens, not on the variable assignment, and it's scalar not "scaler". You should be getting an error message to that effect - please also always post any error messages you are getting here.

Your problem seems to be coming from the assignment that looks like it's my @conv=scalar(localtime($data[2])); because scalar only returns one value, which you are assigning to an array @conv, so @conv is now an array with only one element, $conv[0], but then you access $conv[2] which does not exist. So either access $conv[0] instead of $conv[2], or change @conv to $conv and only work with $conv after that.


In reply to Re: localtime function by Anonymous Monk
in thread localtime function by rsodhia

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.