develooper Front page | perl.perl5.porters | Postings from December 2001

[PATCH] D'oh, Dump and dump...

Thread Next
December 19, 2001 11:50
[PATCH] D'oh, Dump and dump...
Message ID:
I was looking at the closure problem that came up earlier, and trying
to use Devel::Peek to look at the sub references to see what the problem

Unfortunately, my test code kept dumping core.

After much tearing of hair, running debuggers, and re-reading 
perldoc Devel::Peek, I _finally_ noticed that the function is
called Dump and not dump.  perldoc -f dump completed my
embarrassment. :)  

Here's a patch to Devel/, in hopes I'll save the next
newcomer to Devel::Peek my shame...
Mike Giroux
via, but not for, Bear-Stearns

$ diff -u
---        Wed Dec 19 14:42:04 2001
+++     Wed Dec 19 14:44:15 2001
@@ -53,6 +53,7 @@
 =head1 SYNOPSIS

         use Devel::Peek;
+        # NOT dump, which is a built-in which forces a coredump
         Dump( $a );
         Dump( $a, 5 );
         DumpArray( 5, $a, $b, ... );
@@ -80,6 +81,10 @@
 counts on SVs.  This document will take a passive, and safe, approach
 to data debugging and for that it will describe only the C<Dump()>
+Note that using C<dump()> instead of C<Dump()> will result in a core dump.
+This is not a bug; instead, it is the intended behaviour of the built-in
+dump function.

 Function C<DumpArray()> allows dumping of multiple values (useful when you
 need to analyze returns of functions).

Bear Stearns is not responsible for any recommendation, solicitation, 
offer or agreement or any information about any transaction, customer 
account or account activity contained in this communication.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About