use warnings; use strict; my @tab; while(my $l = readline (*DATA) ) { @{$tab[$.-1]}= split '',$l ; foreach my $i (0..$#{$tab[$.-1]}) { unless ($. == 1) { ${$tab[$.-1]}[$i] =~ s/\|/${$tab[$.-2]}[$i +]/g if defined ${$tab[$.-2]}[$i] } } } foreach my $row (@tab) { print @{$row}; } __DATA__ A | |--B | | | |--C | | | |---PQR | |---XYZ |--D | | | |---LMN |---XYZ X |---000
In reply to Re: Parsing a Tree to a Table.
by Discipulus
in thread Parsing a Tree to a Table.
by choroba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |