mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-04 11:37:16 +00:00
Update Percona::Toolkit in all tools.
This commit is contained in:
@@ -37,7 +37,52 @@ BEGIN {
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
our $VERSION = '2.2.2';
|
||||
|
||||
our $VERSION = '2.2.3';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
use Carp qw(carp cluck);
|
||||
use Data::Dumper qw();
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT_OK = qw(
|
||||
have_required_args
|
||||
Dumper
|
||||
_d
|
||||
);
|
||||
|
||||
sub have_required_args {
|
||||
my ($args, @required_args) = @_;
|
||||
my $have_required_args = 1;
|
||||
foreach my $arg ( @required_args ) {
|
||||
if ( !defined $args->{$arg} ) {
|
||||
$have_required_args = 0;
|
||||
carp "Argument $arg is not defined";
|
||||
}
|
||||
}
|
||||
cluck unless $have_required_args; # print backtrace
|
||||
return $have_required_args;
|
||||
}
|
||||
|
||||
sub Dumper {
|
||||
local $Data::Dumper::Indent = 1;
|
||||
local $Data::Dumper::Sortkeys = 1;
|
||||
local $Data::Dumper::Quotekeys = 0;
|
||||
Data::Dumper::Dumper(@_);
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
map { defined $_ ? $_ : 'undef' }
|
||||
@_;
|
||||
print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
|
||||
}
|
||||
|
||||
1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user