You leave the line endings at the end of your file. Most likely, there is whitespace at the end of each line that you want to remove. Such things can happen for example when you create a file with Windows-style line-endings ("\r\n") and then process that file with a perl which only expects Unix-style line-endings ("\n"). As a quick measure of testing that, you could check for whitespace at the end of the lines:
while (<$IN>) {
chomp;
warn "Whitespace at end of line $.: >$_<"
if /\s+$/;
...
};
If that indeed is the case, you can either set the input record separator ($/) to the whitespace sequence, or simply strip off all whitespace.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.