From: Mark Addison Date: Tue, 21 Dec 2004 01:28:39 +0000 (+0000) Subject: localised setting of %Data::Dumper::Maxdepth (and Indent), to stop it polluting X-Git-Tag: v0.11008~580 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35b0679e2afd48e4e29dc84a05b438f1fa7ce29e;p=dbsrgits%2FSQL-Translator.git localised setting of %Data::Dumper::Maxdepth (and Indent), to stop it polluting the rest of perl and breaking Module::Build! --- diff --git a/lib/SQL/Translator/Producer/Turnkey.pm b/lib/SQL/Translator/Producer/Turnkey.pm index de6f7b3..4faf08a 100644 --- a/lib/SQL/Translator/Producer/Turnkey.pm +++ b/lib/SQL/Translator/Producer/Turnkey.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::Turnkey; # ------------------------------------------------------------------- -# $Id: Turnkey.pm,v 1.61 2004-10-13 23:14:06 allenday Exp $ +# $Id: Turnkey.pm,v 1.62 2004-12-21 01:28:38 grommit Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -22,7 +22,7 @@ package SQL::Translator::Producer::Turnkey; use strict; use vars qw[ $VERSION $DEBUG ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.61 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.62 $ =~ /(\d+)\.(\d+)/; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Schema::Constants; @@ -30,7 +30,7 @@ use SQL::Translator::Schema::Graph; use SQL::Translator::Schema::Graph::HyperEdge; use Log::Log4perl; Log::Log4perl::init('/etc/log4perl.conf'); use Data::Dumper; -$Data::Dumper::Maxdepth = 3; +local $Data::Dumper::Maxdepth = 3; use Template; my %producer2dsn = ( @@ -331,8 +331,8 @@ sub dump { my %arg = %{shift @_}; $arg{'indent'} ||= 1; $arg{'depth'} ||= 3; - $Data::Dumper::Maxdepth = $arg{'depth'} if defined $arg{'depth'}; - $Data::Dumper::Indent = $arg{'indent'} if defined $arg{'indent'}; + local $Data::Dumper::Maxdepth = $arg{'depth'} if defined $arg{'depth'}; + local $Data::Dumper::Indent = $arg{'indent'} if defined $arg{'indent'}; return(Dumper($arg{'object'})); } diff --git a/lib/SQL/Translator/Schema/Graph.pm b/lib/SQL/Translator/Schema/Graph.pm index 50b703b..3f41edd 100644 --- a/lib/SQL/Translator/Schema/Graph.pm +++ b/lib/SQL/Translator/Schema/Graph.pm @@ -3,7 +3,7 @@ package SQL::Translator::Schema::Graph; use strict; use Data::Dumper; -$Data::Dumper::Maxdepth = 3; +local $Data::Dumper::Maxdepth = 3; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($ERROR);