There's a warnings::unused module, but the bug log for it notes that it can segfault, which makes me less than enthusiastic about trying it out.

Yeah, so? It's not as if you would leave this module in production, would you?

The author has been honest enough to admit that the module is not perfect. This will at least stop you from wasting precious time trying to determine why your code is segfaulting.

If the module indicates one unused variable, you're already ahead. If your code manages to provoke a segfault, then you could try and cut down the code down to a minimal test case and file a bug report. That way the author hears about it and can attempt to address the problem.

It may be that w::u will never be segfault-free. But I'll be willing to bet that when it does crash, it will do so on a dubious code construct that's probably best rewritten anyway.

I know I restructured a few of my published modules quite extensively when early versions of Devel::Cover crashed trying to process their test suites. I was more interested in getting coverage analysis and thus bending my code to work with D::C rather than the other way around. I observed that the code I had to write to work with D::C was simpler to understand anyway. (More recent versions are far more robust, so one is less likely to encounter the scenario these days, but the lesson still holds true).

• another intruder with the mooring in the heart of the Perl


In reply to Re: Warnings on unused variables? by grinder
in thread Warnings on unused variables? by AZed

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.