Carp argument‑truncation limits in Perl 5.34+ create ambiguous diagnostic output
0 reputation · 16 Mar 2021, 23:29 UTC
When diagnosing a failed Perl deployment, the goal is to retain enough argument detail in Carp‑generated stack traces (e.g., from Carp::confess) to pinpoint which parameter caused the failure across Perl versions 5.30 through 5.38.
However, the introduction of $Carp::MaxArgLen in 5.30 and $Carp::MaxArgNum in 5.34 creates a compatibility boundary: the two limits can combine to truncate arguments to zero length or omit them entirely, and the documentation marks this behavior as experimental with no guaranteed default, while individual CPAN modules may locally reset the variables.
What combination of $Carp::MaxArgLen and $Carp::MaxArgNum should be considered safe to preserve diagnostic usefulness?
How can a deployment script reliably detect whether the current Perl version will truncate argument output before invoking Carp?