well, first of all, the very first line in your code:
file = "D:/perl/02.log";
I think 'file' intended to be a variable, isn't it? If yes, it should be written as '$file'.
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:
open (FH, "<", $file) or die "cant open file";
third, regexp. I think you mean actually
if (/2 failed/)
...according to your question. What you wrote is 'a one to nine digits, then space, then the word "failed"'.