aboutsummaryrefslogtreecommitdiff
path: root/Plugin/Timezone.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Plugin/Timezone.pm')
-rw-r--r--Plugin/Timezone.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Plugin/Timezone.pm b/Plugin/Timezone.pm
index 6dcd0c0..a536ed6 100644
--- a/Plugin/Timezone.pm
+++ b/Plugin/Timezone.pm
@@ -29,9 +29,10 @@ sub time {
return "Syntax: time [nick]" unless @arguments == 1;
my $nick = $arguments[0];
- if (grep {$_ =~ /^$nick$/i} @known_zones) {
+ my ($case_nick) = grep {/^$nick$/i} @known_zones;
+ if ($case_nick) {
my $d = DateTime->now();
- $d->set_time_zone($config{timezone}->{$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 {