package Processor::Hello use strict; use warnings; sub new { return bless {}; } sub process { my($self, $hash) = @_; local $_ = $hash->{message}; return undef unless /^hello|hi|hey|hia|yo/; return "Hello!"; } 1;