..mmh what I'd try too will be setting $CGI::POST_MAX even before CGI::Carp or even in a BEGIN block just after use CGI

No need for any such extra typing , the documentation doesn't lie, and it is as simple as use CGI; $CGI::POST_MAX=...; ... and it should works 100% of the time.

you can also try to do the job on your own, like in A serious security problem with CGI.pm 3.01?:

No no no, that node is ~two decades old. If you're using CGI.pm that old upgrade.

Infact this seems very simliar to what happens in the CGI.pm code: You can insert temporarly some debug statements here in the module to dump what $content_length is at the moment.

A presumed beginner is supposed to debug CGI.pm? No way. Not funny. No.

See also Detecting when a $CGI::POST_MAX limit is exceeded and CGI.pm file upload freaking me out

Meh, long and exactly relevant .... shortcut https://metacpan.org/pod/CGI#Retrieving-cgi-errors


In reply to Re^2: CGI.pm POST_MAX not working by Anonymous Monk
in thread CGI.pm POST_MAX not working by adjuvant

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.