Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
    ...
    @words = sort keys %{+{ map { !$common{$_ = lc $_} ? ($_, 1) : () } @w
    +ords }};
    
    print "@words\n";
    
  2. or download this
    %common = map { lc $_, 1 }  qw/ the and a /;
    @words = qw / hello Hello hello a The there /;
    ...
    
    # get the sorted keys
    @words = sort keys %words;