in reply to Find a pattern
I think 'file' intended to be a variable, isn't it? If yes, it should be written as '$file'.file = "D:/perl/02.log";
Second, in the second line you use a wrong call to 'open'. First parameter to open should be a so called 'file handler', then the operation and file name:
third, regexp. I think you mean actuallyopen (FH, "<", $file) or die "cant open file";
...according to your question. What you wrote is 'a one to nine digits, then space, then the word "failed"'.if (/2 failed/)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find a pattern
by ikegami (Patriarch) on Jan 28, 2011 at 09:50 UTC | |
by elef (Friar) on Jan 28, 2011 at 10:30 UTC | |
by fisher (Priest) on Jan 28, 2011 at 10:27 UTC | |
|
Re^2: Find a pattern
by GrandFather (Saint) on Jan 28, 2011 at 09:35 UTC | |
|
Re^2: Find a pattern
by amvarma (Initiate) on Jan 28, 2011 at 10:04 UTC | |
by GrandFather (Saint) on Jan 28, 2011 at 11:13 UTC | |
by jethro (Monsignor) on Jan 28, 2011 at 10:25 UTC |