Add array support to perl templates and add repl-docs template for perl.