Add signal handler for perl template.