Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by mje (Curate)
on Jan 17, 2012 at 16:03 UTC ( [id://948344]=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)

The data is a basically

[[a,b],[c,d,e,...]]

where c, d and e etc could contain further array references usually no deeper than 3 but the spec for this data does not restrict it to 3. I can basically copy the first array ref and then take N of the c,d,e etc where hopefully the result when Dumped is not longer than 4K. However, it is unlikely I can get an N which provides just over 4K (reducing the work in Dumper) as c, d, e can contain other scalars of varying lengths. An ideal would be picking N which gave just over 4K when Dumped. However, although this could truncate the dumped string less than 4K when N was too small it is still a viable solution as we only need the data accurate up to the truncation and its only 4K because that is the column size - the more the better though.

Replies are listed 'Best First'.
Re^3: Replacement for substr(Data::Dumper($x), 0, 4000)
by flexvault (Monsignor) on Jan 17, 2012 at 16:16 UTC

    mje,

      However, it is unlikely I can get an N which provides just over 4K...
    So pass Dumper 20KB or 100KB or whatever you think! It's still better than 16MB, and you control all the variables yourself!

    Thank you

    "Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-25 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found