It does so work! :) Did you try it? Result:
yep, we ski in dec
A few tips, then:
- If you'll be matching against the same variable
(like $date) multiple times, use the /o operator. That
way Perl will only compile the regex once, not each
time through the loop.
- You could also compile such a regex using
the qr operator. Check that out, as well.
- Of course, in this case, you might want to just
use eq. :)
If I misunderstood what you're asking, let me know.