Ok, understand about the potential clash of $a$b with the sort module, though it seems like bad design that I can clash with system vars that use common names. A problem with all languages that opt for implicitly global vars rather than implicitly local.

I still don't see how your reference to perlvar would help me? The only occurences of $a or $b that I could find in there are where they are used in an example!

I thought and tried inserting the bracketed ternary expressions into the compound expression as you suggested, but have so far been spectacularly unsucessful in preventing them from generating more and worse errors than I am trying to cure.

I realise that this is probably down to my inexperience rather than because it isn't a good idea...so thanks!

Re: Program design: Good, sage advice which in most any other situation I would totally agree with. Trouble in this case is that the variable ($b) in the original example, is actually generated within the compound statement and comes into existance and disappears automagically. I have successfully unwound the statement into a loop which allows me to preinitialise $b at an appropriate block level, but (so far) the syntatic salt needed to make it work within the compound statement eludes me. And as the unwound (looping) statement appears to be considerably less efficient that the compound one, disabling this individual warning for a block encompassing this one statement seems the appropriate way to go.


In reply to Re: Re: Warnings: by Anonymous Monk
in thread Uninitialized value in string warnings (was: Warnings:) by Anonymous Monk

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.