diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-11-07 11:45:16 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-11-07 20:28:03 -0600 |
commit | e7eb9d6b8a020c216e2fe51ba09dd7561a729258 (patch) | |
tree | ff781d0898800ff973dcfa86370f74e86c731f86 /dist | |
parent | 5bbc4d5d842c1afbc106bdd94148920162063f9a (diff) | |
download | perl-e7eb9d6b8a020c216e2fe51ba09dd7561a729258.tar.gz |
limit number of args before formatting
this makes a difference when the number of args is quite large
Diffstat (limited to 'dist')
-rw-r--r-- | dist/Carp/lib/Carp.pm | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm index b35ab69578..23abb483cc 100644 --- a/dist/Carp/lib/Carp.pm +++ b/dist/Carp/lib/Carp.pm @@ -162,12 +162,19 @@ sub caller_info { = "** Incomplete caller override detected$where; \@DB::args were not set **"; } else { - @args = map { Carp::format_arg($_) } @DB::args; - } - if ( $MaxArgNums and @args > $MaxArgNums ) - { # More than we want to show? - $#args = $MaxArgNums; - push @args, '...'; + @args = @DB::args; + my $overflow; + if ( $MaxArgNums and @args > $MaxArgNums ) + { # More than we want to show? + $#args = $MaxArgNums; + $overflow = 1; + } + + @args = map { Carp::format_arg($_) } @args; + + if ($overflow) { + push @args, '...'; + } } # Push the args onto the subroutine |