HTML-ListToTree

 view release on metacpan or  search on metacpan

examples/Sociable.pod.html  view on Meta::CPAN

<p>Attempting to open a new transaction in <code>onCommit</code>, <code>onRestart</code>, or <code>onRollback</code>
closures will generate a fatal error. Any access to sociable variables within those
closures will <strong>not</strong> be transactional, and will reference the sociable value,
<strong>not</strong> any existing private transactional value.</p>

<p>Transactions may be nested; however,</p>

<ul>
	<li>Commits of sequential inner transactions
are <strong>not</strong> applied until the outermost transaction commits.</li>
	<li>Restarts or rollbacks of inner transactions will cascade to <strong>all</strong>
transactions within the thread, including previously completed, but
uncommitted, preceding and inner transactions.</li>
</ul>

<p>As each pending transaction is committed, restarted, or rolled back,
any associated <code>onCmmit</code>, <code>onRestart</code>, or <code>onRollback</code> closures will be invoked.</p>

<p>If a transaction's <code>onCommit</code> closure induces restart or rollback,
or if a transaction's <code>onRestart</code> closure induces rollback,
the <code>onRestart</code> or <code>onRollback</code> closures of <strong>all</strong> pending transactions will be executed,

lib/HTML/ListToTree.pm  view on Meta::CPAN

	return $elem;
}

sub _sort_tree {
	my ($level, $levels) = @_;

	my @nextlevel = ();
	my $entry = 0;
	my $node;
#
#	cascade the root document to all children that don't have a root
#
	foreach my $i (0..$#$level) {
		$node = $level->[$i];
		die "UNEXPECTED ARRAY"
			if (ref $node eq 'ARRAY');
		my $root = ($node->{_link} && ($node->{_link}=~/^([^\#]+)/)) ? $1 : '';
		$level->[$i]->{_node} = $i + 1;
		if (exists $node->{_children}) {
			foreach (@{$node->{_children}}) {
				$_->{_parent} = $node->{_node} - 1;



( run in 1.150 second using v1.01-cache-2.11-cpan-49f99fa48dc )