http://qs1969.pair.com?node_id=104887


in reply to Re: Concordance Generator
in thread Concordance Generator

I re-posted the code using most of the suggestions. With regard to the version thing, I primarily include a version number for my own use, I wasn't trying to adhere to a standard. I didn't even know that there was a standard, to be honest. The sort block was a remnant from when I was going to try to keep the case of the words, rather than converting everything to lower case. I was going to do sort { lc($a) cmp lc($b) }, but ended up dropping the idea cuz it was getting too messy. (Dang, I had a remnant thing in my Fibonacci generator, too. Sorry 'bout that.)

I tried to use your code for creating the list of line numbers, but I kept getting a trailing comma with the output. Any suggestions on that?
___________________
Kurt

Replies are listed 'Best First'.
Re: Re: Re: Concordance Generator
by John M. Dlugosz (Monsignor) on Aug 15, 2001 at 01:48 UTC
    I tried to use your code for creating the list of line numbers, but I kept getting a trailing comma with the output. Any suggestions on that?

    Easy: given $x is a list ref (stored as a hash element in the real program), say print join (',',@$x);

    re $VERSION, yea, it's a standard. You found the node on it? Short version for those just tuning in: you can specify a required version number when loading a module and it dies if the module found is too old.

    re preserving case but sorting case insensitive: look up the Swartzian Transform (spelling something like that).

    I'll go over your code again later tonight, perhaps.

    Keep it up!

    —John