Separate a hash variable into 2 parts in Perl

Dear Perl users/experts,

Could somebody help me how to solve my problem, I have a hash variable that I want to convert into dot file (graphviz).
I know how to convert it to dot file but I need some modification on the output of the hash variable before convert it to dot file.

Eeach key of hash variable (Perl1, Perl2, ....Perl6) will be divided into 2 parts.

The hash variable as below:

    
 'Perl1' => {
                'scripting' => [
                                'language'
                               ],
                                
            },
 'Perl2' => {
                'scripting' => [
                                'language'
                               ],
              },
 'Perl3' => {
                'scripting' => [
                                'language'
                               ],
              },
 'Perl4' => {
                'scripting' => [
                                'language'
                               ],
             },
 'Perl5' => {
                'scripting' => [
                                'language'
                               ],
             },

 'Perl6' => {
                'scripting' => [
                                'language'
                               ],
            },                   
  }       
  

The result that I want is:

"Perl1 Perl2 Perl3" -> "perl4 Perl 5 Perl6"
 
language -> scripting -> "Perl1 Perl2 Perl3 Perl4 Perl5 Perl6"

Can you post what you have tried? And a less-simplistic data sample?

The leaf node (under scripting) is a list containing one element (language). What is the desired output if/when this list contains more than one element?

How was "Perl1 Perl2 Perl3" -> "Perl4 Perl 5 Perl6" derived? Where is the dependency?

Did you want the PerlNs combined into a single node?

  • D

And