in reply to Re: Replacement for substr(Data::Dumper($x), 0, 4000)
in thread Replacement for substr(Data::Dumper($x), 0, 4000)

stealing _dump was my first hunch too, but is that is called on (sub)values, it will be very hard to catch the *total* size. And you will have to force using Dumpperl (a.o.t. using the much faster Dumpxs).

{ my $size = 0; my $org_dump = \&Data::Dumper::_dump; sub Data::Dumper::_dump { $size >= 4000 and return ""; my $s = $org_dump->(@_); $size += length $s; return $s; } }

could be a crude start ...


Enjoy, Have FUN! H.Merijn