in reply to Re^2: reading file
in thread reading file

The reason for that is two-fold.

First the regex sees only one line at a time, so it sees for example ravanan but not the sa\n before it. So you have to change the way you read the file and apply the regex

The second problem is that even if the regex sees the whole file as a single string, /saravanan/ does not match "sa\nravanan", because it doesn't allow a line break in there. So you have to do something to your regex to allow that. Again I'd like to point you to perlretut for that.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.