Many unix commands have been entirely rewritten in Perl
by the
Perl Power Tools project.
You can find a couple of their implementations of grep
here.
I've used
tcgrep on Win32
and it works.
BTW, your /$string/i might be faster as /$string/io since
$string does not change during the duration of the program.