In article <001501c254d3$2666a910$3864a8c0@comice>,
 [EMAIL PROTECTED] (Jeff Aa) writes:
>I have used Perl for a while, and always used dumpvar.pl /

Pleeeeze don't.  AFAIK the only thing in the core that uses it is the
debugger.  I would so love to deprecate it.  You think it's hard to
use, you should try adding enhancements...

>main::dumpvalue() to dump out things (I guess that tells you how long!
>8-))
>
>I had a look at Data::Dumper - but its dumps are either too terse (i.e.
>all one line) or too verbose (i.e. I am dumping data structures and
>don't really need to waste lots of lines to meet the style guidelines
>[some of my hashes and arrays are rather large e.g. MB])

Do you want to dump the whole thing or just part of it?  You don't say
whether you're using this for data inspection or data transfer, although
the implication is the former.

>I have a quick look at Dumpvalue - but that seems to print to STDOUT
>rather than returning a string and letting me pass the results through
>our logging routines, which log to tty and syslog etc.

No problem; just select a tied filehandle before calling Dumpvalue, one
that causes output to go to a string instead of output.  Then select the
original filehandle when done.

>Are there other tidy ways to do dumping? 

You may find it easier to roll your own, if your needs are simple enough.

>What about the wider question
>of logging and log levels [debug verbose more verbose etc etc]? 

That's a bit too wide to give a succinct answer.  Try looking on CPAN.

-- 
Peter Scott
http://www.perldebugged.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to