colours red blue yellow #### #!/usr/local/bin/perl use strict; my $file = 'thesaurus'; # Name the file open(INFO,$file) || die "Cannot open file"; # open the file or say can't open file # Read it into an array print " what are you looking for? "; $a = ; chomp $a; # get rid of a new line while (){ if($file eq "\n"){ last; } my @matches = grep {/$a/i} ; # find all the matches print "The following matches were found: @matches\n"; # print the matches }