Also,  my $trterminator = qr[</tr>\n</table></td></tr></table>]; is never used (it appears only once but that did not produce any warnings, an occurance suggesting I better review the docs).

Interesting. I noticed that my $trterminator is never used, but overlooked the fact that no warning is generated. Turns out, that’s the expected behaviour. From perldiag:

Name "%s::%s" used only once: possible typo

(W once) Typographical errors often show up as unique variable names. If you had a good reason for having a unique name, then just mention it again somehow to suppress the message. The our declaration is also provided for this purpose.

NOTE: This warning detects package symbols that have been used only once. This means lexical variables will never trigger this warning.

Related threads:

I’ve learnt something! Also warnings::unused could be a helpful addition to the toolbox:

13:02 >perl -wE "my $x = 42; say 'hi';" hi 13:02 >perl -Mwarnings::unused -wE "my $x = 42; say 'hi';" hi Unused variable my $x at -e line 1. 13:02 >

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


In reply to Re^2: Example of brainfog (Was: inconsistent regex matching) by Athanasius
in thread Example of brainfog (Was: inconsistent regex matching) by ww

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.