The stupid question is the question not asked | |
PerlMonks |
Leading Characters Not Visible for Certain Array Elements While Printingby justsomeguy (Novice) |
on Oct 30, 2013 at 20:59 UTC ( [id://1060447]=perlquestion: print w/replies, xml ) | Need Help?? |
justsomeguy has asked for the wisdom of the Perl Monks concerning the following question: Dear Monks: In a program that parses a text file by opening and splitting a simple two-column file into array elements, I find that about 50% of the 3700 or so entries print out with the first element visually truncated. I don't mean that the value has changed, just that anything I try to print out in that first position is missing the first 2 characters on about half of the lines as they are displayed. If I 'pad' the line with 2 spaces on the print line, visibility is restored. I can print out the values separately in the program without difficulty. This seems to affect any array values or other variables (or literals) I try to print. This has me stumped. I've searched Google on strings like "perl print not visible" or "perl print truncates" to no avail. Keep in mind that about half of the entries print with no drama at all. I have scrubbed the source data for unprintable characters, etc. Anything--and I mean anything (even the word RECORD) is truncated on the output of the program for those certain records. Here's a sample of the code with some redactions:
The source data is a simple two-column space-delimited file showing short hostname in column 1 and a three-letter identifier in column 2 Your help is much appreciated!
Back to
Seekers of Perl Wisdom
|
|