Template Toolkit 中的 [% %] 和 [%--%] 有什么区别?

What is the difference between [% %] and [%- -%] in Template Toolkit?

Template Toolkit 中的 [% %][%- -%] 有什么区别?

- 自动从 before/after 指令标签中删除一些空格。

参见Template::Manual::Syntax

You can add - or + to the immediate start or end of a directive tag to control the whitespace chomping options. See the PRE_CHOMP and POST_CHOMP options for further details.

请参阅 Template::Manual::Config 了解使用和不使用 pre 和 post 咀嚼效果的良好示例。