in reply to Re^2: /g matches not really global in scalar context!
in thread /g matches not really global in scalar context!

not that smart with a fixed lenght string!

Why not? Firstly, you’re using \b, which condition you’d have to code manually if you were to use a string search – that would require a lot of extra code and would be slower. Secondly, the regex engine is smart enough to do a simple string search itself when it sees simple patterns like yours.

So absolutely, you should use a pattern for the job you’re after.

Makeshifts last the longest.