http://www.perlmonks.org?node_id=863198


in reply to Re^6: Need help comparing 4 dates (Fixed.)
in thread Need help comparing 4 dates

The reason for asking was this bit of the error message you posted:  <DATA> line 2.

Did you get more than one copy of the error message (on different lines)?

Another possibility, though I can't see how it would arise, is that you have and old version of Date::Manip?

C:\test>Perl -MDate::Manip -Esay$Date::Manip::VERSION 5.56

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^8: Need help comparing 4 dates (Fixed.)
by dirtdog (Monk) on Oct 03, 2010 at 19:32 UTC

    I do have an older version (5.54)..I'll install 5.56 and see if that fixes it.

    The warning does repeat for multiple lines...a lot. I was going to capture them in a file and then grep the count, but only the output displayed below was captured in the file

    Also, what is interesting is that the output contains a blank line between the header and result set even though there is no blank line after __DATA__

    EVENT JIM BOB SAM JACK PTRED 4 3 2 1 RED 3 1 2 4 INT 3 4 2 1 PTRED 2 1 4 3 RED 2 1 3 4 INT 4 3 1 2

    Actually, nevermind about the blank line in the result set. I see that yours has it also. Must come from the "+1" in the print.

      Actually, nevermind about the blank line in the result set. I see that yours has it also. Must come from the "+1" in the print.

      Erm, no. The header line, and the following blank line in the output, are printed by this line:

      print scalar <DATA>;

      It has one newline because I didn't chomp it. And the second, because I have -l on the hashbang line:

      #! perl -slw

      Which has the affect of automatically adding "\n" to the end of every print line.

      The +1 in this line:

      print join "\t", $label, map $_+1, sort{ $order[ $a ] <=> $order[ $b ] } 0 .. $#order;

      converts the numbers 0 .. 3 used to index the array while sorting. into the numbers 1 .. 4 used for your desired output.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.