aboutsummaryrefslogtreecommitdiff
path: root/Plugin/Timezone.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Plugin/Timezone.pm')
-rw-r--r--Plugin/Timezone.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/Plugin/Timezone.pm b/Plugin/Timezone.pm
index 53f8f4a..b88b6b9 100644
--- a/Plugin/Timezone.pm
+++ b/Plugin/Timezone.pm
@@ -8,10 +8,10 @@ use DateTime;
my %config;
sub configure {
- my $self = $_[0];
- my $cmdref = $_[1];
- my $cref = $_[2];
- %config = %$cref;
+ my $self = shift;
+ my $cmdref = shift;
+ shift; # run_command
+ $config = shift;
$cmdref->("time", sub { $self->time(@_); } );
@@ -22,7 +22,7 @@ sub time {
my ($self, $irc, $logger, $who, $where, $rest, @arguments) = @_;
my $requester = (split /!/, $who)[0];
- my @known_zones = (keys %{$config{timezone}});
+ my @known_zones = (keys %{$config->{timezone}});
return "Syntax: time [nick]" unless @arguments == 1;
@@ -30,7 +30,7 @@ sub time {
my ($case_nick) = grep {/^$nick$/i} @known_zones;
if ($case_nick) {
my $d = DateTime->now();
- $d->set_time_zone($config{timezone}->{$case_nick});
+ $d->set_time_zone($config->{timezone}->{$case_nick});
my $timestr = $d->strftime("%Y-%m-%d %H:%M %Z");
return "$requester: $nick\'s clock reads $timestr";
} else {