in reply to Re: sorting a table columns using hashes
in thread sorting a table columns using hashes

I like the way you are weaving the test output as POD into your code.

I wonder if there is already a CPAN module allowing to automate this, since $. __LINE__ and caller give the current line of source code.

Might be handy for PM posts

Cheers Rolf

PS: talking about fuzzy requirements, why does the second columns have precedence over the first in your sort?

UPDATE: corrected $. (which is only INPUT_LINE_NUMBER)

UPDATE: see weaving output into code for a proof of concept

Replies are listed 'Best First'.
Re^3: sorting a table columns using hashes (weaving output)
by Marshall (Canon) on May 05, 2011 at 16:35 UTC
    Glad you like my little POD trick. I don't know of any automated modules for this - interesting idea!

    I'm still unsure about the col 1 and col 2 stuff. I guess I keyed in on this phrase "(sorted based on second column..." and thought that was the primary key. My brain had a bit of trouble interpreting the spec. The test data doesn't have enough cases to unambiguously demonstrate the desired behavior. I hope the code is clear enough that the OP can make these precedence tweaks or other desired changes.

    cheers, Marshall