Sort Dumper output by keys

This commit is contained in:
Pragmatic Software 2018-02-28 11:13:56 -08:00
parent 54f025e483
commit 55347ea463
4 changed files with 7 additions and 3 deletions

View File

@ -18,6 +18,7 @@ use strict;
use Time::HiRes qw/gettimeofday/;
use Time::Duration;
use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
use Carp ();
sub new {
@ -60,11 +61,12 @@ sub get_banlist {
my ($self, $event_type, $event) = @_;
my $channel = lc $event->{event}->{args}[1];
return 0 if not $self->{pbot}->{chanops}->can_gain_ops($channel);
delete $self->{banlist}->{$channel};
$self->{pbot}->{logger}->log("Retrieving banlist for $channel.\n");
$event->{conn}->sl("mode $channel +b");
$event->{conn}->sl("mode $channel +q");
$event->{conn}->sl("mode $channel +bq");
return 0;
}

View File

@ -248,7 +248,7 @@ sub add {
my ($self, $index_key, $hash) = @_;
if($self->load_hash_add($index_key, $hash, 0)) {
$self->save_();
$self->save();
} else {
return "Error occurred adding new $self->{name} object.";
}

View File

@ -15,6 +15,7 @@ use strict;
use Carp();
use Time::HiRes qw(gettimeofday);
use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
sub new {
if(ref($_[1]) eq 'HASH') {

View File

@ -16,6 +16,7 @@ use strict;
use Text::Levenshtein qw/fastdistance/;
use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
use Carp ();
use Time::HiRes qw/gettimeofday/;