Rosetta Code/Fix code tags: Difference between revisions

→‎{{header|Perl}}: Allow highlighting by slight code modification
(added perl)
(→‎{{header|Perl}}: Allow highlighting by slight code modification)
Line 13:
 
=={{header|Perl}}==
<lang perl>
 
Syntax highlighting does not work, because <nowiki></lang></nowiki> is inside the code.
 
<pre>
# coding: utf-8
 
Line 37 ⟶ 34:
'intercal', 'c_mac', 'thinbasic', 'java5', 'xpp', 'boo', 'klonecpp',
'blitzbasic', 'eiffel', 'povray', 'c', 'gettext');
 
my $slang = '\lang';
 
while (<STDIN>) {
foreach my $i (@langs) {
s|<$i>|<lang $i>|g;
s|</$i>|</lang$slang>|g;
}
s|<code (.*)>|<lang \1>|g;
s|</code>|</lang$slang>|g;
print;
}
</prelang>
 
=={{header|Python}}==
973

edits