No much help really, but will allow you to trouble shoot the situation.

Also you have "$in{'qry'}" should be without the quotes. This is stringification which you do not want. Perl will see this for face value "the string $in{'qry'}" instead of the actual value "$in{'qry'} actually = testing". This may be your problem as well.

I'm very appreciative of the responses. I have been trying to get this to work all day but even with your code's I was unsuccessful. I was trying to make my original post short and simple so people would not be confused but I think it would be better if I said exactly my problem and what I'm trying to do.

Here it goes,

I have a data base called afkey.db and I have a small code that reads the database and matches any word with the form's input. It is a simple search engine. And when it finds a match in that database I want it to print location to search engine (A) with that key word as the query. I have been able to do that, but when I want to add an else statement so that when there is no match in the data base it will go to search engine (B) but it will go there all the time, regardless of the keywords in the file. With the else statement, the only time it will go to search engine (A) is when I type in what's in the first line. Other wise it always goes to search engine (B). I know that Iím typing in the right keywords, I mean; I open up the database and there right there. It's supposed to be like a redirect based on the keywords in a file (afkey.db). Well now that you know what I am trying to accomplish, here is the code.