Based upon your update, I would say dHarry's diagnosis that you have unaccounted for newlines is correct. One way to fix that would be:

open PL, 'pvclength.txt' or die "Cant open file"; $pvc_l=<PL>; chomp $pvc_l; open GIL, 'gilength.txt'or die "Cant open file"; $gipipe_l=<GIL>; chomp $gipipe_l; open QGBS, 'qgibendsocket.txt' or die "Cant open file"; $gibend_sck_q=<QGBS>; chomp $gibend_sck_q;

See chomp.

You also mention in your OP you "tried removing whitespace from the Qty variables". How? What code did you use? This should be straight-forward using regular expressions.

Please note that because all your variable names are different lengths, your columns will not align - you have a different number of spaces following each one. Again, a simple solution is to follow dHarry's advice and use sprintf.

Also, note you dropped a sigil off of pvc_l in your OP. Please get in the habit of testing code before you post so Monks don't go off chasing red herrings. See How do I post a question effectively? and make sure posted code passes strict and warnings.

Update: Fixed oversights in code. Thanks wfsp.


In reply to Re: File write problem by kennethk
in thread File write problem by perl_seeker

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.