#!/usr/bin/perl %words = (); while ( ) { chomp; $words{ lc( $_ ) } ++; } foreach my $word ( sort keys %words ) { print "$word;$words{ $word }\n"; }