in reply to Re^5: Normal regexes stop working
in thread Normal regexes stop working
I tried to have the warn statement print out exactly what they were defined with, in that last error case 'Polygram compilation albums', and you can see the eq comparison succeeded whereas the regex did not (the weird bug).
As per another suggestion I will print them out using Data::Dumper with $Data::Dumper::Useqq=1 and report back. If you've moved on, just feel free to ignore and sorry for wasting your time. If you want to see something else in particular, please let me know.
I didn't paste in the full file because it is 7204 lines and proprietary. I could extract the piece and run it standalone, but every time I do that it works fine. In fact, it works fine in this case as well, at the beginning. Only after some time this particular block (the one I pasted in as is) begins to fail.
Edit: here was the printout from the first failure after making that change:
And here is an equivalent standalone example that works fine, but eventually breaks within the script:warn qq(\nDILBERT 1a: "), Dumper($q_meta), " ", Dumper($page_title) if + $is_dilbert; DILBERT 1a: "$VAR1 = "Haji\\ Ayub\\ Afridi"; $VAR1 = "Haji Ayub Afridi";"
#!/usr/bin/perl my $q = 'Haji Ayub Afridi'; my $page_title = 'Haji Ayub Afridi'; my $q_meta = quotemeta($page_title); my $tmp_test = ($page_title =~ /$q_meta/i) || 0; if (!$tmp_test) { print "BAD"; } else { print "GOOD"; }
|
|---|