Hello monks!
I am generally ok with regexes but this one has me stumped. I am doing a massive search and replace operation across a few hundred pages and I seem to have a problem getting my match found. I have enough code below to recreate the problem.... (the href reference is an exact cut and paste).
#!/usr/bin/perl
$text = 'YAY! <a href="/cgi-bin/ruling?candy=265-23&path=/rules/other/
+265-23&file_num=265-23&action=Show_Form" class="subCat9">Click to sub
+mit</a> YAY!';
$find='<a href="/cgi-bin/ruling?candy=265-23&path=/rules/other/265-23&
+file_num=265-23&action=Show_Form" class="subCat9">Click to submit</a>
+';
$replace="This is a replacement";
# Would like to see
# YAY! This is a replacement YAY!
$text=~s/$find/$replace/g;
print $text;
# I get
# YAY! <a href="/cgi-bin/ruling?candy=265-23&path=/rules/other/265-23&
+file_num=265-23&action=Show_Form" class="subCat9">Click to submit</a>
+ YAY!
I am guessing it's some sort of interpolation issue maybe? Does anyone have a clue ?
Thank you so much for your advice.
Sherab