There seems to be some confusion in responders - you are splitting on a comma, because its a comma separated file. So that makes sense. (Assuming there are no commas in the data itself, of course. If thats even a possibility you should use a CSV module from CPAN.)

The code you have shown should use eq. The == comparison is forcing numeric context, taking as much of the string as it can that looks numeric, in this case everything up to the first /.

Compare:

perl -e 'print "==\n" if "12/Mar" == "12/Jun";' perl -e 'print "eq\n" if "12/Mar" eq "12/Jun";'

(Which give '==' and no output respectively)

You do say you tried eq, so you may have additional problems. If you post more code you'll get a thorough review. (Perhaps more than you want...)

You may also want to look at the many Date modules on CPAN, so you don't require a specific format.

qq


In reply to Re: Parsing a date from comma-delimited file by qq
in thread Parsing a date from comma-delimited file by playing18

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.