Author: tim.bunce
Date: Fri Jan 9 15:55:09 2009
New Revision: 668
Modified:
trunk/lib/Devel/NYTProf/Data.pm
trunk/lib/Devel/NYTProf/Reader.pm
Log:
Replace old $ENV{NYTPROF_EXIT_AFTER_LOAD} hack with shiny new
$ENV{NYTPROF_ONLOAD} hack.
Make _dumper output more readable.
Modified: trunk/lib/Devel/NYTProf/Data.pm
==============================================================================
--- trunk/lib/Devel/NYTProf/Data.pm (original)
+++ trunk/lib/Devel/NYTProf/Data.pm Fri Jan 9 15:55:09 2009
@@ -122,7 +122,12 @@
}
$profile->_clear_caches;
- #warn _dumper($profile);
+ # a hack for testing/debugging
+ if (my $env = $ENV{NYTPROF_ONLOAD}) {
+ my %onload = map { split /=/, $_, 2 } split /:/, $env, -1;
+ warn _dumper($profile) if $onload{dump};
+ exit $onload{exit} if defined $onload{exit};
+ }
return $profile;
}
@@ -823,6 +828,8 @@
sub _dumper {
require Data::Dumper;
+ local $Data::Dumper::Sortkeys = 1;
+ local $Data::Dumper::Indent = 1;
return Data::Dumper::Dumper(@_);
}
Modified: trunk/lib/Devel/NYTProf/Reader.pm
==============================================================================
--- trunk/lib/Devel/NYTProf/Reader.pm (original)
+++ trunk/lib/Devel/NYTProf/Reader.pm Fri Jan 9 15:55:09 2009
@@ -112,9 +112,6 @@
bless($self, $class);
$self->{profile} = Devel::NYTProf::Data->new({filename =>
$self->{file}});
- # a hack for testing/debugging
- exit $ENV{NYTPROF_EXIT_AFTER_LOAD} if defined
$ENV{NYTPROF_EXIT_AFTER_LOAD};
-
return $self;
}
--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]
-~----------~----~----~----~------~----~------~--~---