#!/usr/bin/perl -w ####################################################### # class7_06_subst_find_first_threes # # print out the first 3-letter "words" in each line of a file # # modified by Sharon Tuttle from "Learning Perl", # by Schartz and Phoenix # # last modified: 5-2-03 ####################################################### while (<>) { chomp; if (/(\b[A-Za-z]{3}\b)/) { print "$1\n"; } } # end of class7_06_find_first_threes