my @grep_result = `grep -r $string .`; foreach my $result (@grep_result) { print; }