in reply to pattern matching

This is assuming that you are looking for an exact match on the entire line. If not, then you can get rid of the leading ^ and $ .
#!/usr/local/bin/perl use strict; my $file = 'thesaurus'; # Name the file # get this into an array unless the file is too big open(INFO,$file) || die "Cannot open file"; my @lines = <INFO>; close(INFO); print " what are you looking for? "; $a = <STDIN>; chomp $a; my $found = 0; foreach(@lines){ # get the match if($found == 0){ chomp; if(/^$a$/){$found = 1;} } # print the next line else{ print; } }
Hope this helps....

Mick