Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Neat Debugger tricks

by QM (Vicar)
on Nov 17, 2005 at 03:49 UTC ( #509275=note: print w/ replies, xml ) Need Help??


in reply to Re: Neat Debugger tricks
in thread Neat Debugger tricks

4. dump a data structure: use Data::Dumper; p Dumper($foo)
Unless you're just sweet on D::D, I prefer
x $foo
For hashes, this works better:
x \%foo

-QM
--
Quantum Mechanics: The dreams stuff is made of


Comment on Re^2: Neat Debugger tricks
Select or Download Code
Re^3: Neat Debugger tricks
by harleypig (Scribe) on Jun 07, 2007 at 19:18 UTC
    If the output from x (or p) is too long for your screen then prepend the pipe. The output will be piped through less (or whatever 'o pager' is set to) and you can scroll back and forth at your pleasure.
    harleypig@harleypig ~ $ perl -de 0 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> o pager? pager = '|/usr/bin/less' DB<2> |x \%::
    and the output is the same as 'x \%::' but in a less session.
    Harley J Pig

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-07-14 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (254 votes), past polls