"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:
Or something like that :) To avoid the warnings, always assign an empty string as an alternative if the assignment may be undefined.$stext = (split(/\s/,$_,2))[1] || '';
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |