1
2
3
4
5
6
7
8
9
10
CLASS_UE;CLASS_UN;
"";"CAD/Blue/Two/B/RMI151LNR";"
"CAD";"/Blue/Two/B/RMI151LNR";"
"CAD/Blue";"/Two/B/RMI151LNR";"
"CAD/Blue/Two";"/B/RMI151LNR";"
"CAD/Blue/Two/B";"/RMI151LNR";"
"unsortiert";"/Green/Three/V/WGZ117WWN";"
"unsortiert/Green";"/Three/V/WGZ117WWN";"
"unsortiert/Green/Three";"/V/WGZ117WWN";"
"unsortiert/Green/Three/V";"/WGZ117WWN";"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sub array_tree {
my @vars = @_;
my $peon = scalar @vars;
my $perent = shift @vars;
while ( $peon > 0 ) {
foreach my $sequence (@vars) {
print "\"$perent\";";
print '"';
foreach (@vars) {
print "/$_";
}
print '";"' . "\n";
$perent = "$perent" . "/" . shift(@vars);
$peon = scalar @vars;
}
}
return 1;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$VAR1 = {
'CAD' => {
'Blue' => {
'Two' => {
'K' => {
'XFW485YKT' => 1
},
'B' => {
'RMI151LNR' => 1
}
}
},
'Green' => {
'One' => {
'N' => {
'NTN181AVN' => 1
}
}
}
},
1 2 3 4 5 6 7 8
sub print_tree { my ( $tree, $parent, $chain ) = ( @_, $EMPTY, $EMPTY ); ref $tree eq "HASH" or return; for ( sort keys %$tree ) { print /^\s*\z/ ? "<blank>" : "$parent;". "$chain"."$_", "\n"; print_tree( $tree->{$_}, $_, "$chain"."$_"."_"); } }
2013-12-18T11:09:47 DakarusCode (perl): (dl )1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19sub array_tree { my @vars = @_; my $peon = scalar @vars; my $perent = shift @vars; while ( $peon > 0 ) { foreach my $sequence (@vars) { print "\"$perent\";"; print '"'; foreach (@vars) { print "/$_"; } print '";"' . "\n"; $perent = "$perent" . "/" . shift(@vars); $peon = scalar @vars; } } return 1; }
1 2 3 4 5 6 7 8 9 10
sub array_tree { my @vars = @_; my $perent = shift @vars; while (@vars) { print '"$perent";"/' .join("/",@vars) ."\";\"\n"; $perent .= "/" . shift(@vars); } }