Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: problem while searching for a pattern in a file

by kiruthika.bkite (Scribe)
on Mar 24, 2010 at 08:18 UTC ( #830478=note: print w/ replies, xml ) Need Help??


in reply to problem while searching for a pattern in a file

Hi,
I have executed your program in my system.It sent the mail only if the pattern get matched.
I have tested your code with the following input.

Input

contents of results.txt
\n
\n
\n
This is testing

In this case mail didn't send.

And,
if($line!~m/\b$pattern/)

This condition will match the pattern other than "hello".
So when newline is encountered this condition will get true.(\n!="hello").
So in this case also mail will send.


Comment on Re: problem while searching for a pattern in a file

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://830478]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2014-04-16 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (431 votes), past polls