in reply to Remove equal but different duplicates from array

Just force all the entries to lowercase before comparing them.
@allnames = grep(!$saw{lc}++, @names);
Update: See L~R below.

Replies are listed 'Best First'.
Re^2: Remove equal but different duplicates from array
by Limbic~Region (Chancellor) on Jul 23, 2004 at 19:53 UTC
    Eimi Metamorphoumai,
    While lc works on $_ if not specified, you can't put it in hash brackets and expect it not to be stringified (battle of DWYMisms). To make it work change it to:
    @allnames = grep(!$saw{lc()}++, @names); # or @allnames = grep(!$saw{lc $_}++, @names);

    Cheers - L~R

      Thanks everyone.

      I used:

      @allnames = grep(!$saw{lc $_}++, @names);

      Worked great!