You don't tell us what your input is and what output you get, and how it is different from what you want.
Again, your regular expression still does not do what you may think it does.
$line =~ s/\btest\b/^\#/ig
The right hand side of a regular expression is a simple string.
In reply to Re^3: find & replace a string in perl
by Corion
in thread find & replace a string in perl
by vr786
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |