Hi I am having a hellofa time converting my shell script to a perl script. I am hoping to find some direction. The shell script basically searchs the system for all files and checks them for certain words, then pipes the output to a file, then strips out "fale-positive" results, and sends results to a file, then emails and ftp's file.
On the perl side what I am having trouble with is the "grep"ing of the words out of the files. In the shell script I do this by
while read words.dat
do
find . -type f | xargs grep -i "${words.dat}=" 2>/dev/null >> out.log
done < words.dat
this gives me the list of files that contain the word(s) in words.dat.
I can get perl to work if I use each word individualy like this...
@find = `find . -type f | xargs grep -i sales= 2>/dev/null`;
@find = `find . -type f | xargs grep -i price= 2>/dev/null`;
@find = `find . -type f | xargs grep -i invoice= 2>/dev/null`;
but I need to feed it a list of words in a file. How can I do this?
thanks