cant get perl to pull information right

Actually the regexp should have really been like this, with the dot escaped:

elsif ($line =~ /^Sark DNS 4\.X ([^\r\n]+)/ism) {

The "i" makes it case insensitive, the "s" treats it as a single string even if there are embedded newlines in the string and "m" matches over multiple lines. "i" could be returing a true match if the case of the text is different than what you have posted, "s" could be causing the regexp to find the \n on the end and return a true match, personally I thought that would not be necessary to return a true match but maybe it is.

Remove the 's' or the 'm' and try again. See which one is actually causing the regexp to return a true match. My guess is that its the "s". The "i" and "m" might not be doing anything.

As far as the regexps I was following your lead when I used these character classes:

([^\r\n]+)

They might not be necessay since I changed the way you are searching the data, line by line, instead of as one big line of text. You can probably change them to:

(.+)

and that will slurp up everthing until the end of the lines which appears to be what you want. That should avoid the \n needing to be matched with the "s" modifier. You should probably drop the "s" if you do change the regexps so that any trailing newline is not captured.

Ok, I tested it with just 's' not good
Then 'm' no luck

Then finally 'i' and that worked, so /sm not good and /i is good

Is this because, the lines wrap? I would like to know please.

Thanks !

Final Code

elsif ($line =~ /^Sark DNS 4\.X ([^\r\n]+)/i) {

As I said, the "i" makes the regexp match case-insensitive, so for example, an "S" or an "s" will both match for something like "Size". All I can surmize is that there is a case matching issue that the "i" is over coming, although judging by the sample output data you have been posting I don't see what it is.

Yup, That did it

Thanks !