in reply to Re: (ar0n: use 'eq') Re: Compare file content with a variable content
in thread Compare file content with a variable content

The string value was in fact surrounded by space characters so it was NOT the same as the other string. I have added some trimming:
for ($modified_scalar) { s/^\s+//; s/\s+$//; }
and it did the trick!