[Catalyst] patch to not set Data::Dumper config globally

Robin Berjon robin.berjon at expway.fr
Mon Jul 4 15:30:38 CEST 2005


Hi,

I had an issue recently with Catalyst setting $Data::Dumper::Terse to 1 
globally which causes other modules which expect Data::Dumper to produce 
its output using its default configuration.

As far as I can tell the following patch should fix that (it sure fixed 
my problem). It was originally against the previous release but I've 
updated it to (hopefully) work against 5.30.


--- Engine.pm.old       Mon Jul  4 15:23:32 2005
+++ Engine.pm   Mon Jul  4 15:24:45 2005
@@ -17,9 +17,6 @@
  use Catalyst::Response;
  use Catalyst::Utils;

-# For pretty dumps
-$Data::Dumper::Terse = 1;
-
  __PACKAGE__->mk_classdata('components');
  __PACKAGE__->mk_accessors(qw/counter request response state/);

@@ -276,6 +273,8 @@

      my ( $title, $error, $infos );
      if ( $c->debug ) {
+       # For pretty dumps
+       local $Data::Dumper::Terse = 1;
         $error = join '', map { '<code class="error">'  . 
encode_entities($_) . '</code>' } @{ $c->error };
         $error ||= 'No output';
         $title = $name = "$name on Catalyst $Catalyst::VERSION";

-- 
Robin Berjon
   Senior Research Scientist
   Expway, http://expway.com/





More information about the Catalyst mailing list