"When I run this with "use warnings" I get a gazillion warnings reading: "Use of uninitialized value in concatenation (.) or string at oeaxe.p line 23, <QIN> line 784." I don't have any idea what this means.

It means what it says :) To get rid of the warning, assign variables an empty string or 0 as appropriate. ie, in this instance:

# change this my ($qnum,$code,$ctext,$ntext,$stext); # to my ($qnum,$code,$ctext,$ntext,$stext)=('','','','','');

Oh, and you're assigning $stext from a split. You might want to amend that too:

$stext = (split(/\s/,$_,2))[1] || '';
Or something like that :) To avoid the warnings, always assign an empty string as an alternative if the assignment may be undefined.

cLive ;-)

updated: added more explanation...


In reply to Re: There is more than one way (and mine is not the best) by cLive ;-)
in thread There is more than one way (and mine is not the best) by NovMonk

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.