summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r--perl-install/interactive.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 5285781ab..c32553a88 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -425,4 +425,30 @@ sub wait_message {
sub kill {}
+
+
+sub helper_separator_tree_to_tree {
+ my ($separator, $list, $formatted_list) = @_;
+ my $sep = quotemeta $separator;
+ my $tree = {};
+
+ each_index {
+ my @l = split $sep;
+ my $leaf = pop @l;
+ my $node = $tree;
+ foreach (@l) {
+ $node = $node->{$_} ||= do {
+ my $r = {};
+ push @{$node->{_order_}}, $_;
+ $r;
+ };
+ }
+ push @{$node->{_leaves_}}, [ $leaf, $list->[$::i] ];
+ ();
+ } @$formatted_list;
+
+ $tree;
+}
+
+
1;