This is because in the script, the variable holding the new datafile is initialized to a space first:

# Buffer for temporary swap store. $Buffer = ' ';

Initialize the buffer to be empty like the following to solve your immediate problem:

# Buffer for temporary swap store. $Buffer = '';

A word of advice:That script is horrible code, and while I didn't see a wide gaping spammer hole in it, the sister script http://optionalreaction.net/cgiperl/nomail.pl is a really wide open invitation for spammers to abuse it. As it seems, you don't have much experience programming and debugging other peoples programs. I can only recommend you to consult somebody who understands these things instead of copying and pasting scripts from the web in the hope that they work as you want and can't be abused to the detriment of others. The folks at http://nms-cgi.sourceforge.net/ have well tested and supported CGI scripts that try to cater to many needs. Give those scripts a look instead.


In reply to Re: Annoying whitespace(s)... by Corion
in thread Annoying whitespace(s)... by reaction

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.