From: Guido B. <gd...@le...> - 2014-12-03 14:46:50
|
On 03/12/2014 13:07, Jozef Mojzis wrote: > Need generate an output from an Mason component where the lines should > start with the '%' character. > > Because the '%<space>' at the beginning of the lines are executed as > perl lines, currently I'm using > > <% $perc %> the remaining content of the line. > > and the $perc is defined in the %init section as my $perc = '%'; > > The above works, but for many lines it is an terrible solution. Is it > possible somewhat generate Mason output where some lines contains the > '%' character at the beginning of the line? > > If currently not, would be nice to have in the Mason syntax the double > %% (like in the printf), what would be simply copied to the output as > one '%', e.g. the following > > %%there lines start > % for my $x (1..3) { > %% this is <% $x %> > % } > %%there lines end > > should ouput > > %there lines start > % this is 1 > % this is 1 > % this is 2 > %there lines end > If "\%" is acceptable in your case: <pre> \%there lines start % for my $x (1..3) { \% this is <% $x %> % } \%there lines end </pre> <%filter> s/^\\%/%/ </%filter> bye gdo |