in reply to Creating tree with unique categories out of parent-child pointer list
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"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating tree with unique categories out of parent-child pointer list
by bryank (Acolyte) on Jun 17, 2009 at 15:16 UTC | |
by ikegami (Patriarch) on Jun 17, 2009 at 15:47 UTC |