|Just another Perl shrine|
Re^6: Reading msg fileby monkee (Initiate)
|on Oct 21, 2019 at 18:22 UTC||Need Help??|
I am having a problem printing the filename on a condition.
I have successfully run the following code, which prints the entire two emails that are contained in the folder.
What I'd like PERL to do is read the file, search the body for the work "training", then print the name of the file only if the body contains the keyword.
One email contains the keyword and the other doesn't. Let's say the file names are "email 1.msg" and "email 2.msg". The first contains the work "training" in the body, the other doesn't. I want PERL to print only "email 1.msg" because it contains the keyword.
Seems I need to use an IF statement and =~/commit/ somewhere.
Note: the larger application will be to search thousands of emails within a folder.
Discipulus fixed code tags