That typo was created especially for my question, I'm afraid. My apologies for that.

I can't provide the code that I was having provlems with because I made so many changes getting it to work that I no longer have the original. I only know that when I cut and pasted everything inside the 'if' statement the script magically worked. The only problem is that in order to provide code for this thread I cut and pasted the whole lot back inside the 'if' statement, deleting the subroutine, tested it and the blooming script worked like a charm! Sounds of jonnyfolk beating his head against brick wall!

It is fortunate that I asked the question (despite the copious -- votes!) because I had obviously jumped to the wrong conclusion which would not have been helpful to my 'perl progress' in the future.

Thanks to all who pointed out the error of my ways


In reply to Re: Re: Using loops inside an 'if' statement by jonnyfolk
in thread Using loops inside an 'if' statement by jonnyfolk

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.