ASCII Example:
sub EmitCode
{
($code, $depth) = @_;
my $ret="";
while (@code > $depth)
{
local($_) = pop @code;
$ret .= "</$_>\n"
}
while (@code < $depth)
{
push (@code, ($code));
$ret .= "<$code>\n"
}
if ($code[$#code] ne $code)
{
$ret .= "</$code[$#code]><$code>\n";
$code[$#code] = $code;
}
return $ret;
}
Page last edited January 25, 2000 |