In a DWIM way, perl requires a closing brace/paren/etc if it is an open/close kinda symbol. If it is plain like '/' or a closer like '}' then it expects the same symbol as the opener and closer. The closer is always at tmps{5}, if it is an opener the compliment is a closer. Otherwise, it is another of the same symbol.
Cool code