<&| SELF:wrapper, title => Odin::escapify($m, $title) . " (odin.gg Paste Bin)" &>

odin.gg Paste Bin: <% $title %>

% if ($lang eq 'txt') {
<% $content |h %>\
% } else {
<%perl>
	my $kid = open my $fh, "-|" // die "fork: $!";
	if ($kid == 0) {
	  open my $hl, "|-", "highlight", "-Ohtml", "-f", "-t8", "-S$lang"
	    or die "open highlight: $!";
	  syswrite $hl, $content // die "highlight write: $!";
	  close $hl or die "highlight kid: $!, $?";
	  exit 0;
	} else {
	  while (sysread $fh, my $buf, 8192) { $m->print($buf); }
	  close $fh and waitpid $kid, 0
	    or die "highlight parent: $!, $?";
	}

% }
%# <%args> $content $title $lang $tag $edit %# <%init> my $db = Odin::open_db; %# <%once> use utf8;