Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Replacement for substr(Data::Dumper($x), 0, 4000)

by Tux (Prior)
on Jan 17, 2012 at 15:34 UTC ( #948337=note: print w/ replies, xml ) Need Help??


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


Comment on Re^2: Replacement for substr(Data::Dumper($x), 0, 4000)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948337]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (25)
As of 2013-06-19 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many continents have you visited?









    Results (658 votes), past polls