Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    while (<>) {
        $COUNT{$_}++ for map lc, split /\W+/;
    }
    print "$_: $COUNT{$_}\n" for sort keys %COUNT;
    
  2. or download this
    #!/usr/bin/perl -w
    @W = qw( hello world );
    ...
        $COUNT{$_}++ for grep { $_~~@W } map lc, split /\W+/;
    }
    print "$_: $COUNT{$_}\n" for sort keys %COUNT;