in reply to keep only unique elements in an array displaying number of duplcates.

Seems you're on the right track
... my $col_name = $elements[1]; # don't print # just count them # print " $col_name \n" if ! $seen{$col_name}++; $seen{$col_name}++; } while ( my ( $col_name, $times_seen ) = each %seen ) { print "$col_name: $times_seen\n"; }
Also
open (INPUT,"$INFILE") or die "\n$filerror\$INFILE",,1;
What is that? Why two commas? Why "1"? Is that a Windows thing?

Replies are listed 'Best First'.
Re^2: keep only unique elements in an array displaying number of duplcates.
by john.tm (Scribe) on Jul 28, 2014 at 04:55 UTC
    The ',,1' at the end means the file is opened as a read only, so if the user leaves the file open the script still runs for them, without the pop up dialog box.
Re^2: keep only unique elements in an array displaying number of duplcates.
by Anonymous Monk on Jul 28, 2014 at 07:04 UTC

    What is that? Why two commas? Why "1"? Is that a Windows thing?

    No, its not a windows thing or a perl thing -- perl on windows is pretty much like perl on linux -- die does the same thing its documented to do

    Whatever it is, its his thing not demonstrated in the program posted