The stupid question is the question not asked | |
PerlMonks |
Re: Text File Problemby buckaduck (Chaplain) |
on Nov 06, 2002 at 22:10 UTC ( [id://210928]=note: print w/replies, xml ) | Need Help?? |
That is a very complicated way of doing what you really want, which is probably this:
Next problem: The s/// substitution is useless. This block of code only executes when $value1 equals $ag. So you're replacing the value with itself! I think you want if() rather than unless(). And you're probably right about removing the /g flag. While we're at it, your $value1 could have special regex characters, so you should protect them with \Q..\E syntax:
Update: Added \Q..\E recommendation. buckaduck
In Section
Seekers of Perl Wisdom
|
|