my %seen; while (<>) { chomp; my ($p,$c) = split /:/; ++$seen{$p} if !$seen{$p}; $p .= " $seen{$p}" if $seen{$p} > 1; ++$seen{$c}; $c .= " $seen{$c}" if $seen{$c} > 1; print("$p:$c\n"); }
In reply to Re: Creating tree with unique categories out of parent-child pointer list
by ikegami
in thread Creating tree with unique categories out of parent-child pointer list
by bryank
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |