in reply to Can I Use Variables In A Regex?

I'm not trying to be sarcastic, but : what happened when you tried? Wouldn't it be easier to just type that all out and then print the value of $l to see if it's what you expect?

The short answer is, yes you can do things like that. If the part that you are matching contains regex characters like periods and parens, you will need to use quotemeta() to escape them.