Help for this page

Select Code to Download


  1. or download this
    my @items = qw(foo poot bar foo baz poot foo);
    my %counts;
    ...
    ++$counts{$_} for @items;
    
    print "$_: $counts{$_}\n" for sort keys %counts;
    
  2. or download this
    use strict;
    
    ...
    }
    
    print "$count " if defined $count; # Need to process the last group