X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FObject.pm;h=d729261699bd632ac19fa2850f4822ec307f0866;hp=375cf60752cbe3f3910443f02de4dfdef797ba01;hb=df963a63491f0c26a26592d51534d5d440bc6f26;hpb=e25788124125a81db61e076ca9faf8f9fab3a690 diff --git a/lib/Mouse/Object.pm b/lib/Mouse/Object.pm index 375cf60..d729261 100644 --- a/lib/Mouse/Object.pm +++ b/lib/Mouse/Object.pm @@ -113,6 +113,13 @@ sub DEMOLISHALL { } } +sub dump { + my $self = shift; + require Data::Dumper; + local $Data::Dumper::Maxdepth = shift if @_; + Data::Dumper::Dumper $self; +} + 1; __END__ @@ -152,5 +159,20 @@ L time. You may put any business logic deinitialization in DEMOLISH methods. You don't need to redispatch or return any specific value. + +=head2 B + +From the Moose POD: + + C'mon, how many times have you written the following code while debugging: + + use Data::Dumper; + warn Dumper $obj; + + It can get seriously annoying, so why not just use this. + +The implementation was lifted directly from Moose::Object. + =cut +