in reply to grep problems and file copying issues

This one should work:
open (TEST, "test.txt") or die $!; @array = <TEST>; for (grep /$seachstring/, @array) { print; }