Match Word

#!/usr/local/bin/perl
#program that counts the number of input lines that contain the word the

$thecount = 0;
print ("Enter the input here:\n");
$line = <STDIN>;
chop($line);
while ($line ne "") {
        if ($line =~ /\bthe\b/) {
                $thecount += 1;
        }
        $line = <STDIN>;
	chop($line);
}
print ("Number of lines containing 'the': $thecount\n");