<:
for my $op (@ops) {
$op or do {
- print "<tbody>\n";
+ say '<tbody>';
next;
};
map { !!$_->[1] && qq( title="$_->[1]"), $_->[0] }
[map { EscapeHTML($_) } split /\n/, $_, 2]
) for $monad, $dyad;
- print "</td>\n";
+ say '</td>';
}
:></table>
my $codepoint = ord $chr;
my $ascii = $codepoint <= 127;
- print "<tr><th>$chr\n";
+ say '<tr><th>', $chr;
my $info = $glyphs->glyph_info($codepoint);
my ($class, $name, $mnem, $entity, $string) = @$info;
print "<td>$_" for sprintf('%X', $codepoint), EscapeHTML($name || '?');
}
print "\n";
}
- print "</table></div>\n";
+ say '</table></div>';
}
:>
}
print "\n";
}
- print "</table>\n";
+ say '</table>';
}
:>
for my $colchars (@columns) {
print '<table class="glyphs dimap"><col>';
print qq'<colgroup span="$_">' for map {scalar @$_} @{$colchars};
-print "</colgroup><col>\n";
+say '</colgroup><col>';
for my $section (qw{thead tfoot}) {
print "<$section><tr><th>↳";
print '<th>', EscapeHTML($_) for map {@$_} @{$colchars};
- print "<th> \n";
+ say '<th> ';
}
for my $c1group (@chars) {
print '<tbody>';
printf "\n".'<td class="%s" title="%s">%s',
join(' ', @class), EscapeHTML($desc), $glyph;
}
- print "\n<th>", EscapeHTML($c1), "\n";
+ say "\n<th>", EscapeHTML($c1);
}
}
-print "</table>\n";
+say '</table>';
print '<hr>' if exists $get{split};
}
our $VERSION = 'v1.0';
$header{content_type} = 'text/plain; charset=us-ascii';
-print '" vim digraph proposals <http://sheet.shiar.nl/digraphs>', "\n";
+say '" vim digraph proposals <http://sheet.shiar.nl/digraphs>';
PLP_END { print "\n" };
open my $include, '<', 'shiar.inc.txt' or do {
<h1>IM emoticons</h1>
<:
-print '<div class="section">'."\n";
+say '<div class="section">';
for my $system (qw'gmail msn yahoo') {
my @info = do "emoji-$system.inc.pl";
my $title = $meta->{name} // $system;
$title = qq{<a href="$_">$title</a>} for $meta->{source} || ();
- printf '<div class="section"><h2>%s</h2>'."\n\n", $meta->{name} // $system;
- print '<table><tbody>'."\n";
+ say sprintf '<div class="section"><h2>%s</h2>', $meta->{name} // $system;
+ say '<table><tbody>';
for (my $i = 0; $i <= $#info; $i++) {
my $name = $info[$i];
unless (ref $info[$i+1] eq 'ARRAY') {
- printf '</table><table><tbody>'."\n", $name;
+ say sprintf '</table><table><tbody>', $name;
next;
}
my ($input, $flags, $char, $desc) = @{ $info[++$i] };
- printf('<tr><th><img src="%s" alt="%s"><td><kbd>%s</kbd><td>%s%s'."\n",
+ say sprintf('<tr><th><img src="%s" alt="%s"><td><kbd>%s</kbd><td>%s%s',
sprintf($meta->{ $flags =~ /\bext\b/ ? 'iconext' : 'icon' } // '%s', $name),
EscapeHTML($name),
EscapeHTML($input),
$char ? '<td>'.chr($char) : '',
);
}
- print "</table></div>\n\n";
+ say "</table></div>\n";
}
-print "</div><hr>\n\n";
+say "</div><hr>\n";
$line or next; # explicitly ignore empty input
my ($date, $subject) = split /[\t\n]/, $line;
$date =~ s/ \K/<small>/ and $date .= '</small>';
- print "<p><strong>Last update</strong>: $date $subject</p>\n";
+ say "<p><strong>Last update</strong>: $date $subject</p>";
}}
:>
my $verrow = $info->{$vernum};
$verrow->{unstable} and next unless exists $get{v};
- print '<div class="section">'."\n";
- printf '<h2>%vd <small>%s</small></h2><dl>'."\n", $vernum, $verrow->{release};
+ say '<div class="section">';
+ say sprintf '<h2>%vd <small>%s</small></h2><dl>', $vernum, $verrow->{release};
for (@{ $verrow->{new} }) {
my ($topic, $desc, $attr) = @{$_};
if ($attr) {
}
$desc .= sprintf ' <em class="ex">(%s)</em>', $title;
}
- printf '<dt>%s<dd>%s'."\n", $topic, $desc || '<br/>';
+ say sprintf '<dt>%s<dd>%s', $topic, $desc || '<br/>';
}
- printf '<dt>Unicode</dt><dd>v%s'."\n", $_ for $verrow->{unicode} || ();
- print "</dl>\n";
- print "</div>\n\n";
+ say sprintf '<dt>Unicode</dt><dd>v%s', $_ for $verrow->{unicode} || ();
+ say '</dl>';
+ say "</div>\n";
}
data => [$datafile],
});
-print "<h1>$scver{game} units</h1>\n\n";
+say "<h1>$scver{game} units</h1>\n";
my $units = do $datafile;
die "Cannot open unit data: $_\n" for $@ || $! || ();
my $patch = shift @{$units}
or die "Cannot open unit data: metadata not found\n";
-print "<p>Unit properties as seen or measured in $scver{name}\n$patch.\n";
-print "Also see the $_ table.\n" for join(', ',
+say "<p>Unit properties as seen or measured in $scver{name}\n$patch.";
+say "Also see the $_ table." for join(', ',
('<a href="/sc/2">StarCraft 2: HotS</a>') x ($scver{major} < 2),
('<a href="/sc">original SC: Brood War</a>') x ($scver{major} > 1),
);
-print "</p>\n\n";
+say "</p>\n";
sub addupgrade {
my ($ref, $increase, $org) = @_;
my ($race, $cat) = ('', '');
for (@rows) {
if ($grouped) {
- printf '<tbody id="%s"><tr class="race"><th colspan="20"><h2>%s</h2>'."\n",
+ say sprintf '<tbody id="%s"><tr class="race"><th colspan="20"><h2>%s</h2>',
$race = $_->{race}, ucfirst $race
unless $race eq $_->{race};
}
stylesheet => [qw'light dark mono red'],
});
-print "\n";
+say '';
if (not $source) {
print "<h1>Source files</h1>";
print "<p>Project code distributed under the AGPL. Please contribute back.</p>";
- print '<ul>'."\n";
+ say '<ul>';
for (glob '*.plp') {
chomp;
- printf '<li><a href="/source/%s">%1$s</a></li>'."\n", EscapeHTML($_);
+ say sprintf '<li><a href="/source/%s">%1$s</a></li>', EscapeHTML($_);
}
- print "</ul>\n\n";
+ say "</ul>\n";
}
else {
- print "<h1>Source of $source</h1>\n";
+ say "<h1>Source of $source</h1>";
if ($source =~ m{(?:/|^)\.}) {
die "File request not permitted\n";
vim_options => [@Text::VimColor::VIM_OPTIONS, '+:set enc=utf-8'],
);
my $parsed = $hl->marked;
- print "<pre>\n";
+ say '<pre>';
foreach (@$parsed) {
my ($type, $contents) = @{$_};
$contents = Encode::decode_utf8($contents);
print Text::VimColor::_xml_escape($contents);
print "</$tag>" if $tag;
}
- print "</pre>\n";
+ say '</pre>';
}
else {
- print "<pre>\n";
+ say '<pre>';
print EscapeHTML(Encode::decode_utf8(ReadFile($source)));
- print "</pre>\n";
+ say '</pre>';
}
- print "\n";
+ say '';
}
) if $info->{href} or $info->{title};
if (my $mapinfo = $info->{rgbmap}) {
- print '<table class="color mapped">'."\n";
- printf "<caption>%s</caption>\n", $caption;
+ say '<table class="color mapped">';
+ say sprintf '<caption>%s</caption>', $caption;
print coltable_hsv(@{$mapinfo});
- print "</table>\n\n";
+ say "</table>\n";
}
if (my $table = $info->{table}) {
- print '<table class="color mapped">'."\n";
- printf "<caption>%s</caption>\n", $caption;
+ say '<table class="color mapped">';
+ say sprintf '<caption>%s</caption>', $caption;
for my $row (@$table) {
print '<tr>';
print colcell(ref $_ ? @$_ : $_ ? reverse split /:/ : undef) for @$row;
print "<tr><td colspan=$width>", img_egapal(\@imgpal, @{$_});
}
}
- print "</table>\n\n";
+ say "</table>\n";
}
if (my $palette = $info->{list}) {
my $rows = 8;
my $columns = ceil(@{$palette} / $rows);
- print '<table class=color>', "\n";
- printf "<caption>%s</caption>\n", $caption;
+ say '<table class=color>';
+ say sprintf '<caption>%s</caption>', $caption;
for my $row (0 .. $rows - 1) {
print '<tr>';
for my $col (0 .. $columns - 1) {
);
print "<tr><td colspan=$columns>", img_egapal($imgpal, @{$_});
}
- print "</table>\n\n";
+ say "</table>\n";
}
}
my ($source, $title) = @$_;
my @table = do "writing-$source.inc.pl";
if ($! or $@) {
- print "<h2>$title</h2>\n";
+ say "<h2>$title</h2>";
printf "<p>Table data not found: <em>%s</em>.</p>\n", $@ || $!;
next;
}