#!/usr/local/bin/perl #Usage: perl simple_dict.pl word #Script that opens dictionary.txt which contains on each line a word and its definition, #and outputs all the definitions for word, and then counts the total number of such definitions. open (IN,") { @s=split(/ /,$line,2); if ($s[0] eq $word) { print "$s[1]"; $n+=1; } } print "\n The word $word has $n definitions \n";