#!/usr/bin/perl -w use strict; #This script selects only the five-letter and six-letter words from a list of words open FH1, "all_words.txt" or die $!; open (FH2, '>>trimmed_words.txt') or die $!; while () { if (length ==5 or length==6) {print FH2 }; }