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

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

Thread Next
From:
mgiroux
Date:
December 19, 2001 11:50
Subject:
[PATCH] D'oh, Dump and dump...
Message ID:
03CF7D5B2CFFD211990300A0C95DEA0C080BEB68@whmsx18.is.bear.com
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
was.

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/Peek.pm, in hopes I'll save the next
newcomer to Devel::Peek my shame...
-- 
Mike Giroux
via, but not for, Bear-Stearns


$ diff -u Peek.pm.orig Peek.pm
--- Peek.pm.orig        Wed Dec 19 14:42:04 2001
+++ Peek.pm     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()>
 function.
+
+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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About