in reply to perl grep help!

Have you ever heard of indenting your code?

Anyway, the first problem is the !=, which does a numeric comparison; you most likely want to do a string comparison with ne. The second problem is that you are obviously trying to compare an array (which has a @ sigil) with a scalar value (which has a $ sigil). That cannot work.

Edit: Regarding your edit of the question: Could you try to write sentences? Concise and clear language makes you a better programmer. It also helps others understand what you want to say. They can then, in turn, better help you with your problems.