|Perl Monk, Perl Meditation|
Weird DBI behaviourby toadi (Chaplain)
|on Aug 19, 2005 at 12:02 UTC||Need Help??|
toadi has asked for the
wisdom of the Perl Monks concerning the following question:
Writing this not to find a solution to a problem. But try to understand why something behaves that way.
I had to debug some code written by some else because sometimes it did't do what it needed todo.
We need to fetch paths to files from mysql but ordered by a certain field. The guy wrote following code:
for me this looked weird, but the coding style of other people always look weird. But the trouble whas that in some cases the paths printed weren't sorted anymore by some_other_number row in mysql.
I solved it like this:
Now it got sorted even in those rare cases it wasen't sorted. But I couldn't give a reasonable explanation why in some cases it wasen't sorted in the first example??? Can someone enlighten me???
My opinions may have changed,
but not the fact that I am right