#! usr/bin/perl #midterm part 1 use warnings; open (TEXTFILE, 'text.txt') or die ("Cannot open file : $!"); $big_string = ; $big_string = lc ($big_string); $big_string =~ s/\(|\)/ /g; @words = split (/[,.\s+]/, $big_string); foreach (@words){ push @gt_three_char_words, $_ if /[a-zA-Z]{4,}|[a-zA-Z]{3,}'/; } foreach (@gt_three_char_words) { $hash{$_}++; } foreach (%hash) { print $_, "\n"; }