perl module for event based pattern matching