我试图将一个'mason‘变量传递给一个在HTML之前运行的Perl自动处理程序脚本。这有没有可能。
<!--- MASON -->
<html>
<body>
<%init>
my $sub_headline = 'this is text';
</%init>
###HEADER###
</body>
</html>
<!--- AUTOHANDLER --->
my $m_header = '<div class="m-portlet__head">
<div class="m-portlet__head-caption">
<div class="m-portlet__head-title">
<h3 class="m-portlet__head-text">###TITLE###</h3>
</div>
<p>$sub_headline</p>
</div><!-- /.caption -->
</div><!-- /.head -->';
$html =~ s/###HEADER###/${m_header}/i;发布于 2018-03-28 08:03:47
最终为头部创建了一个组件,并为传入的arg添加了一个条件。然后盗用正确的HTML。
https://stackoverflow.com/questions/49505010
复制相似问题