If you don't post code for something like this it means you think there is something wrong with perl, and not with what you are doing :).

Strip down your script to just the open statement and look at it again. If you still can't see what's wrong, then post the code so we can all see it.

In the meantime the following works for me (no added whitespace):

#!/usr/bin/perl -w use strict; use CGI ':standard'; open FH, '> data.txt' or die $!; print FH 'testing123'; close FH; print header(), start_html(-title => "test"); print "finished"; print end_html();
Hope that helps...

In reply to Re: File Truncation Question by jonnyfolk
in thread File Truncation Question by arrow

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.