Help for this page

Select Code to Download


  1. or download this
    my @non_unique = qw/carpet car pet/; # fails on 'car' and 'pet'
    my @non_unique = ("bob and sue","bob"); # fails on space seperated wor
    +ds
    
  2. or download this
    #!/usr/local/bin/perl -w
    use strict;
    ...
    $^ = "SortedWordsAndCountHeader";
    $~ = "SortedWordsAndCount";
    write for @unique;
    
  3. or download this
    Words               Count
    bob and sue             1
    ...
    carpet                  2
    bob                     1
    car                     1