I am reading an input file to create a hash. My data looks like this. This is after I ran the code without sorting by the value. I need to add the sort by value,ie delay.
pin Name related_pin time_type rise_fall delay DQ5_RX_CLK M2CLKP c_rise rise_transition 0.014446 DQ2_RX_CLK M2CLKP c_rise rise_transition 0.014464 DQ0_RX_CLK M2CLKP c_rise rise_transition 0.014452 DQ3_RX_CLK M2CLKP c_rise rise_transition 0.014452 DQ7_RX_CLK M2CLKP c_rise rise_transition 0.014430 DQ4_RX_CLK M2CLKP c_rise rise_transition 0.014446 DQ8_RX_CLK INT_CLK c_fall fall_transition 0.199360 DQ6_RX_CLK INT_CLK c_fall fall_transition 0.199322 DQ1_RX_CLK INT_CLK c_fall fall_transition 0.199500 DQ5_RX_CLK INT_CLK c_fall fall_transition 0.199248 DQ2_RX_CLK INT_CLK c_fall fall_transition 0.199368
to create the hash I read in a file
$timing1{$related_pin}{$timing_type}{$rise_fall}{$pinname} = $delay;Here is my code
foreach my $rName ( keys %timing1 ) { foreach my $tType ( sort keys %{$timing1{$rName}}) { + foreach my $rF ( sort keys %{$timing1{$rName}{$tType}}){ + foreach my $pinName ( keys %{$timing1{$rName}{$tType}{$rF}}) +{ print OUTFILE2 " $pinName\t $rName\t $tType\t $rF\t $timin +g1{$rName}{$tType}{$rF}{$pinName} \n"; } } } }
In reply to Re^2: Sorting Multilevel Hashes
by newCoder
in thread Sorting Multilevel Hashes
by newCoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |