This does not even compile, and even if it did, $string does not contain either @begin or @end (try printing it without doing any replacement). Have a look at Loops's post on that point.
If strict gives you errors (when you actually use it, and don't just put it when you update your code on perlmonks), it's nearly always a sign that the code is wrong, and doesn't mean what you expect. Same goes for warnings.
In reply to Re^2: need a regular exdpression in perl
by Eily
in thread need a regular exdpression in perl
by praveenchappa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |