in reply to problem in running UNIX command through perl

I made 2 files: patternfile and testfile, each containing 1 word "perl". The following worked. So I'm guessing your variable filenames are screwed up, or you don't know that the -f option precedes a patternfile, OR you are not getting any matches.
#!/usr/bin/perl my $ouput = `egrep -f patternfile testfile > output`; print "$output\n";
#prints nothing, but output contains the word perl

The following also works

#!/usr/bin/perl my $p = 'patternfile'; my $t = 'testfile'; my $o = 'output'; my $ouput = `egrep -f $p $t > $o`; print "$output\n";

I'm not really a human, but I play one on earth Remember How Lucky You Are