in reply to Re^5: sort != sort
in thread sort != sort
I'm not saying that what you're seeing is not a Perl bug. But your code is not yet convincing. You are fairly close though - you just need to show where @Notes is filled with data, and with what data. Note that Data::Dumper will output a string that is valid Perl code, so you can use Data::Dumper to get a canned version of the data that exhibits this behaviour.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: sort != sort
by halfcountplus (Hermit) on Oct 25, 2010 at 19:05 UTC | |
I'm not saying it is a perl bug, but I am saying it is not a bug in my code, or an inconsistency in the data. I'm completely satisfied with this explanation (and thank you for egging me on to that point!) since I do not see anything going wrong beyond the fact that @Notes simply remains unchanged at the end of the sort. If you want to explain further about what exactly you mean about the use of Data::Dumper that I haven't done already (that's where the previous dump came from), I'm listening (the bit about getting "a string that is valid Perl code, so you can use Data::Dumper to get a canned version of the data that exhibits this behaviour" is not clear to me). For the curious, here's the package for the object:
Here's the actual construction:
The databases are not relational, they are flat files. Example of the plaintext source: The only difference between that one and the "markup" one is the SNIPPED part contains html. Nb, that all the db files have already been verified line by line to ensure they are structured correctly. And as I've said, the final output demonstrates no mistakes in the data set. I can't force anyone to believe that, of course. Notice I'm using fatal warning and logging inconsistencies (there are none reported at this point, and the db has about 15000 notes in it). ps. for the astute: yes, those hrefs are not uri_encoded, however, that was not my decision, I'm working to spec. | [reply] [d/l] [select] |
by tye (Sage) on Oct 25, 2010 at 20:01 UTC | |
If this is mod_perl and you turn on warnings, you might see "will not stay shared" in your error log as a hint to what might be causing the problem. - tye | [reply] |
by halfcountplus (Hermit) on Oct 25, 2010 at 23:38 UTC | |
| [reply] |
by Corion (Patriarch) on Oct 25, 2010 at 19:13 UTC | |
So, where in the code you've shown do you sort the things? Likely, there is some place where you either sort the wrong thing, sort by the wrong column or assign the result to the wrong thing (a global variable instead of a lexical variable or the other way around). But to determine that, we'll need to see the code as a (small) whole instead of as a collection of selected excerpts. | [reply] |
by halfcountplus (Hermit) on Oct 25, 2010 at 19:31 UTC | |
Maybe also worth mentioning this is a revision (new features) of code I wrote last year that has been used on a production server daily since then. So it's already gone thru a lot of tweaking, testing, usage/error logging, and debugging. I've been asked to implement this elsewhere, and I've never received any complaints. | [reply] |
by furry_marmot (Pilgrim) on Oct 26, 2010 at 19:53 UTC | |