sub substr {
	local($what, $where, $howmuch) = @_;
	if ($where < 0) {
		$where = -$where;
		unpack("@* X$where a$howmuch", $what);
	}
	else {
		unpack("x$where a$howmuch", $what);
	}
}

sub signed_ord { unpack("c", $_[0]); }
