Other Monks have given you good advice regarding the structure of your code. I would just like to point out a more succinct way of reading your queries into an array. Reading a filehandle in list context with an array on the LHS will read the whole file, one line per array element and if passed an array of lines, chomp will very kindly operate on each and every line so your
my @query; while(<HH>){ chomp; push @query,$_; }
could be written as
my @query = <HH>; chomp @query;
and it could even be shortened to a single line
chomp( my @query = <HH> );
I hope this is helpful.
Cheers,
JohnGG
In reply to Re: Sort of basic search engine/pattern matching problems
by johngg
in thread Sort of basic search engine/pattern matching problems
by bvulnerbility
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |