Other people said this but in more jargon than was necessary. qr// is a request to compile a regular expression. /s is a modifier to an expression that is to be compiled. Unless you tell the compiler the /s when the expression is being compiled then it doesn't have an effect.
It might be worth having perl throw away the previous compilation work if the current match's flags don't match the expression's flags. It'd then behave somewhat like you expected (except that then you're compiling more often than you thought).
In reply to Re: Unexpected qr// behavior
by diotalevi
in thread Unexpected qr// behavior
by pbeckingham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |