package Processor::Time; use strict; use warnings; sub new { return bless {}; } sub process { my($self, $hash) = @_; local $_ = $hash->{message}; #Is this input for us? return undef unless /^!time\s*/; # Slurp up the args s/^!time\s*//; my @args = split /\s/; # Return help if it was requested, otherwise return GMT time. return "Usage: !time [timezone]" if defined($args[0]) && $args[0] =~ /help/i; return scalar gmtime(time); } 1;