So in find_message _parse_args is called twice. Are you sure that _parse_args(_parse_args($data)) equals _parse_args($data) ? I'm not saying this is the problem, but it might be worthwile to print out the contents of $msg_info with Data::Dumper. I know from mistakes I make that they turn up at unexpected places.