There's more than one way to do things | |
PerlMonks |
regex error puzzleby ww (Archbishop) |
on May 09, 2006 at 17:39 UTC ( [id://548280]=perlquestion: print w/replies, xml ) | Need Help?? |
ww has asked for the wisdom of the Perl Monks concerning the following question:
update, ca 5 mins after posting: bmann posted correct answer just about same time as tye was helping me see my error on the cb. Thanks all! (solution: s/\Q$delete_candidate\E//)
This started out as demo-answer to a node now-deleted (because it was near identical dupe of another, [id://#548211], which has data slightly different). But then, ka-ching!, AS 5.8.6 on W2K spat an error I did not expect, to wit: "Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE ... Well, as you can see in code below, that's not exactly what's in the regex, but it's sorta' close to what's in line 7. BTW: data in this code is as OP posted, except this has more lines and varying years.
the asterisk appears to me to be properly escaped; AFICT, Mastering Regular Expressions supports that... So does this occur in other distributions? I doubt AS cares about correcting an older v. unless this is generic... and then only if I haven't contributed an error of my own that explains this.CAUTION: see bmann below. full error message - to which I should have paid more careful heed - correctly IDed error line thusly: ... at date_elim.pl line 10, <DATA> line 7. <DATA> line 7; not code line 7.
Back to
Seekers of Perl Wisdom
|
|