Monks,

A CGI script that takes in a number of text fields and writes them to a text file seems to be truncating some of the larger strings. This script has been working fine for over a year now, and the one thing that all the truncated strings have in common is that they are exceptionally long (> 7 pages of text), so I don't think it's a problem with the script logic.

All the script itself does is grab the strings from the query params, throw them into string variables or hashes, perform regular expression type magic, and write them to a file. I don't think there is a problem with the regexp, because they are pretty harmless "remove certain characters" pattern match and substitution. And they are only truncating the fields with very long strings--I would expect a bad regexp to trash everything.

The strings seem to be getting truncated in the neighborhood of 46060 characters (~45k).

My questions:

Thanks,
Chris

In reply to CGI post truncating string? by alienhuman

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.