in reply to Re^2: promoting array to a hash
in thread promoting array to a hash

It will be slightly quicker. However, it is of less use. My version will DWIM references while yours won't.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

Replies are listed 'Best First'.
Re^4: promoting array to a hash
by BrowserUk (Patriarch) on Jun 14, 2004 at 06:03 UTC

    Finding unique references and then sorting them huh?


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
      Who said anything about sorting them? And, this has been very useful when dealing with lists of singletons. :-)

      ------
      We are the carpenters and bricklayers of the Information Age.

      Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      I shouldn't have to say this, but any code, unless otherwise stated, is untested

        Sorry ;). I was referring to the comment in the OP's code #reduces a file to a sorted list of unique words.

        For the more general case your method is better.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail