#!/usr/bin/perl -w use strict; print "Please enter the name of the file to search:"; while (<>){ print; } print "Enter a word to search for:"; chomp( my $input = ; my $ctr=0; foreach($filename){ if (/\b$input\b/){ $ctr++; } } print "Frequency: $ctr\n"; exit;