in reply to noncase-sensitive sorting

You will have to read the documentation of sort carefully -
perldoc -f sort
Somewhere in the doc it says -
# now case-insensitively @articles = sort {uc($a) cmp uc($b)} @files;
I think you are getting lazy, texuser74. ;-)

Replies are listed 'Best First'.
Re: Re: noncase-sensitive sorting
by texuser74 (Monk) on Dec 02, 2003 at 06:50 UTC

    Thanks Roger

    in a manual i read the following commad, sort {uc($a) cmp uc($b)}(keys %IN)

    but really i don't understand about that keys, thatz why i posted here

    once again thanks for your help

      There's lots of discussion below that is interesting, but I'm guessing it's also pretty deep for (what seems to me) a relative "perl newbie" poster ...

      Efficiency aside (and in the spirit of 'how the hell do I get this to work'), why not use:

      @files = sort { lc $a cmp lc $b } @files;
      ???

      And as you build your perl skills, revisit the efficiencies of your code.

      Ok, I must be reading a different set of manual than yours. Anyway, that (keys %IN) returns an array a list containing the hash keys for %IN.

        not array, list