Sorry I thought that was a standalone code example and it was clear that $test was $q_meta and $test2 was $page_title as that was the only =~ in there.

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:

warn qq(\nDILBERT 1a: "), Dumper($q_meta), " ", Dumper($page_title) if + $is_dilbert; DILBERT 1a: "$VAR1 = "Haji\\ Ayub\\ Afridi"; $VAR1 = "Haji Ayub Afridi";"
And here is an equivalent standalone example that works fine, but eventually breaks within the script:
#!/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"; }

In reply to Re^6: Normal regexes stop working by yegg
in thread Normal regexes stop working by yegg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.