Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^8: Need help comparing 4 dates (Fixed.)

by dirtdog (Scribe)
on Oct 03, 2010 at 19:32 UTC ( #863199=note: print w/replies, xml ) Need Help??

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

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.

Replies are listed 'Best First'.
Re^9: Need help comparing 4 dates (Fixed.)
by BrowserUk (Pope) on Oct 04, 2010 at 00:27 UTC
    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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863199]
[perldigious]: On occasion my scripts break, because they will do something that seems laregly pointless to me... like in this case, changing a column name from "ABC Category" to "ABC Category Override".
[perldigious]: Being the ignorant one, my initial reaction to that is, "that's sort of a dick move, a lot of people like me expect column names like that to stay the same, why the hell would you change them like that for seemingly no good reason?"
[perldigious]: Or is my irritation/ frustration well founded?
[Corion]: perldigious: That seems to be more the export and likely it's the recipients of that export that like the titles changes
[Corion]: ... "changed"
[Corion]: I usually expect fixed header names, but am sometimes lenient in the order of columns. But changing the report titles often sounds to me as if you are not the sole consument of the export ;)
[shmem]: perldigious: as always - if it ain't broke, don't fix it. Ther must be a very compelling reason for changing column names in a database. Those are rare.

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-05-25 13:31 GMT
Find Nodes?
    Voting Booth?