When you present code here, the best is to give us something that is as short as possible, that actually runs and that reproduces the problem. I didn't run your two "format" code examples because it was "too much effort" - make it easy for us to click, download and run. Otherwise there is some guesswork involved.

If you have a single file that you use, use a __DATA__ segment for that data. That file handle is already "open" and you can access it:  while(<DATA>){..}.

I actually ran the code that I gave you and I know that it at least runs on my machine. Please give us the same in return.

If some code is not working, give us the exact code (preferably something that we can run easily) and the exact error message - don't give us the short explanation like you'd give your 35th cousin in Chickenblister, Wyoming where-ever the heck that is! Get down and dirty with the details!

If you look at my first answer to your post, you will see that it is a complete runnable program, including a __DATA__ segment. This "=" in column one (eg =prints) is a "trick" - its actually a use of POD - Plain Old Documentation. I often use that in Monk posts so that I can put some comments (like the actual program output) in the code without interfering with the program or its __DATA__ segment. For code without a __DATA__ segment, you can just put __END__ and all after that are just comments (doesn't matter to Perl).

Having said that, welcome to Monks!


In reply to Re^3: Assistance fixing a "format" call by Marshall
in thread Assistance fixing a "format" call by bobdabuilda

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.