in reply to Please Help: A regular expression problem
As BrimBorium said, you need a set of parens inside the match operation,
if(/($pattern)/)as the outer pair are part of the conditional.
And just BTW, you're missing a semi-colon after print "please enter your pattern: " without which Perl will cough up a syntax error. When you post, it will serve you well to copy-paste code that compiles. In many cases, code that doesn't will simply cause some Monks (yeah, me included, sometimes) to throw up their hands and move on without trying to answer the underlying question (which, in any case, may be impossible to discern from a non-compiling code sample).
|
|---|