always load Data::Dumper
Data::Dumper is in core sice Perl 5.005, so set a minimum Perl dependency and always load Data::Dumper.
This commit is contained in:
parent
2a8e12db63
commit
66d132cd4b
1 changed files with 9 additions and 14 deletions
|
@ -36,14 +36,20 @@
|
|||
# http://forge.mysql.com/projects/view.php?id=44
|
||||
#
|
||||
package main;
|
||||
|
||||
use 5.005;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use diagnostics;
|
||||
use File::Spec;
|
||||
use Getopt::Long;
|
||||
use File::Basename;
|
||||
use Cwd 'abs_path';
|
||||
|
||||
use Data::Dumper;
|
||||
$Data::Dumper::Pair = " : ";
|
||||
|
||||
# Set up a few variables for use in the script
|
||||
my $tunerversion = "1.6.1";
|
||||
my ( @adjvars, @generalrec );
|
||||
|
@ -2792,30 +2798,19 @@ END_TEMPLATE
|
|||
}
|
||||
sub dump_result {
|
||||
if ($opt{'debug'}) {
|
||||
|
||||
if (try_load('Data::Dumper')) {
|
||||
badprint "Data::Dumper Module is needed.";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
use Data::Dumper qw/Dumper/;
|
||||
$Data::Dumper::Pair = " : ";
|
||||
debugprint Dumper( \%result );
|
||||
}
|
||||
|
||||
debugprint "HTML REPORT: $opt{'reportfile'}";
|
||||
|
||||
if ($opt{'reportfile'} ne 0 ) {
|
||||
if (try_load('Text::Template')) {
|
||||
badprint "Text::Template Module is needed.";
|
||||
exit 1;
|
||||
}
|
||||
if (try_load('Data::Dumper')) {
|
||||
badprint "Data::Dumper Module is needed.";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
use Text::Template;
|
||||
use Data::Dumper qw/Dumper/;
|
||||
$Data::Dumper::Pair = " : ";
|
||||
|
||||
my $vars= {'data' => Dumper( \%result ) };
|
||||
|
||||
my $template = Text::Template->new(TYPE => 'STRING', PREPEND => q{;}, SOURCE => $templateModel)
|
||||
|
|
Loading…
Reference in a new issue