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