This won't work. If the string comes in as "/test/smi" and I simply place the string inside the qr, it breaks. e.g. I'd get qr//test/smi//;, which doesn't help me.
I can get rid of the close //'s easily enough but getting the /smi outside the regexp is harder.