Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
All I did was ask a simple question after RTFM, and after trying several different things, and after using SuperSearch. I'm not an idiot, nor am I lazy.
BUT, to humor you, from perlfaq4:
So yeah, it ought to be really simple. But if that is the case, shouldn't I be able to make the test fail when the two hashes are different? Another thing I'm curious about: I mentioned that the test unexpectedly succeeded. There really isn't anything interesting when that happens. What information should I have provided? In any event, I've actually tracked down the problem. There were two:
So PodMaster-- for posting and not actually helping. All I needed was confirmation that I was using FreezeThaw correctly. Too bad you couldn't do that, or at least keep silent. Anyway, here's the only thing I had to change to the original code. Instead of the ok() line I used:
So the test now does the right thing. Now I just have to make sure ReadCrossLinks() does the right thing... --J Update: Added working version of the code to the bottom of this reply node. Update 2: The confusion for me was in the text from perlfaq4 that says The first reports that both those the hashes contain the same data, while the second reports that they do not. This let me to believe that cmpStr was not cmpStrHard, and that perhaps there was a typo in the code example. Only after I understood what the two functions do did the phrase make sense. But that's backwards. The docs are supposed to help me understand the functions, not prove my understanding after the fact. FreezeThaw wasn't any better, since it's highly geared toward OO programming (of which I admit to knowing little). I think the text in perlfaq4 would read better as:
The first reports that the hashes %a and %b shown contain the same data, while the second reports that they are different, since $a{EXTRA} and $b{EXTRA} point to the same data, but are not equal to each other. (This assumes that I know what I'm talking about, of course, but I think that's correct.) A little wordier, but much clearer, IMvHO. In reply to Re^2: Using FreezeThaw correctly?
by Rhys
|
|