You don't have warnings turned on, do you?

Not for the quick and dirty stuff. I use -w and strict at specific points in my development process, but usually I stick to techniques that I know to be clean.

It's probably just a personal thing, but I find that constantly using warnings is worse for me than checking my work at intervals. If I get a warning during continuous use, I just correct it and move on. My primary goal at that point is to make sure my latest piece of code produces the result that I want. When I use warnings at intervals, each warning pass is a specific test of the code's integrity. My only concern at that point is whether the code is clean, so I take the time to find ways to make sure my code stays clean in the future.

Mistakes like this one show me when I'm playing with things I shouldn't play with at all. If I need mechanical assitance to write a piece of code correctly, I probably won't be able to read it six weeks from now. And IMO, writing code that even I can't read without assistance is a problem. If I can't find a version that works, is clean, and is easy for me to remember, I write the technique off as being too tricky and look for other solutions.


In reply to Re^2: The perils of being tricky by mstone
in thread The perils of being tricky by mstone

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.