1 2 3 4 5 6 7 8 9 10 11
foreach my $time ( sort {$a <=> $b} keys %{$Signal_ref}) { print"my signal: $Signal_ref->{$time} at t = $time \n"; # first test if (defined $Signal_ref->{$time}) { my $SigValue{$time} = $Signal_ref->{$time}{'signal_1'}; print"my values: $SigValue{$time} \n"; } }
1 2 3 4 5 6 7
foreach my $time ( sort {$a <=> $b} keys %{$Signal_ref}) { use Data::Dumper; print "my signal at t = $time:\n"; print Dumper $Signal_ref->{$time}; ... }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
my %Signal_ref = ( 10.005108 => { PSIP1 => "-0.039999999999992", SBC_SC_A1_AR2 => { DATA => "22 0D 00 00 20 80 F8 7F ", DLC => "8" } }, 10.015101 => { PSIP1 => "-0.330000000000013", SBC_SC_A1_AR2 => { DATA => "D2 0E 00 00 27 80 BE 7F ", DLC => "8" } }, 10.025102 => { PSIP1 => "-0.169999999999987", SBC_SC_A1_AR2 => { DATA => "88 0F 00 00 20 80 DE 7F ", DLC => "8" } }, 10.034626 => { PSIP1 => "-0.490000000000009", SBC_SC_A1_AR2 => { DATA => "CB 00 00 00 00 80 9E 7F ", DLC => "8" } }, 10.045139 => { PSIP1 => "-0.27000000000001", SBC_SC_A1_AR2 => { DATA => "47 01 00 00 17 80 CA 7F ", DLC => "8" } }, 10.055142 => { PSIP1 => "-0.449999999999989", SBC_SC_A1_AR2 => { DATA => "11 02 00 00 F1 7F A6 7F ", DLC => "8" } }, 10.065121 => { PSIP1 => "-0.129999999999995", SBC_SC_A1_AR2 => { DATA => "FD 03 00 00 12 80 E6 7F ", DLC => "8" } }, ); my $i = 1; for my $time(sort {$a<=>$b} keys %Signal_ref) { print"Stimestamp_"."$i : $time\n"; $i++; for my $msg(sort keys %{$Signal_ref{$time}}) { print"my signal: $msg\n"; #print"$Signal_ref{$time}\n"; } print "\n"; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
Signal_ref = { '10.005108' => { 'PSIP1' => '-0.039999999999992', 'SBC_SC_A1_AR2' => { 'DATA' => '22 0D 00 00 20 80 F8 7F ', 'DLC' => '8' } }, '10.015101' => { 'PSIP1' => '-0.330000000000013', 'SBC_SC_A1_AR2' => { 'DATA' => 'D2 0E 00 00 27 80 BE 7F ', 'DLC' => '8' } }, '10.025102' => { 'PSIP1' => '-0.169999999999987', 'SBC_SC_A1_AR2' => { 'DATA' => '88 0F 00 00 20 80 DE 7F ', 'DLC' => '8' } }, '10.034626' => { 'PSIP1' => '-0.490000000000009', 'SBC_SC_A1_AR2' => { 'DATA' => 'CB 00 00 00 00 80 9E 7F ', 'DLC' => '8' } }, '10.045139' => { 'PSIP1' => '-0.27000000000001', 'SBC_SC_A1_AR2' => { 'DATA' => '47 01 00 00 17 80 CA 7F ', 'DLC' => '8' } }, '10.055142' => { 'PSIP1' => '-0.449999999999989', 'SBC_SC_A1_AR2' => { 'DATA' => '11 02 00 00 F1 7F A6 7F ', 'DLC' => '8' } }, };
1 2 3 4 5 6 7 8 9 10 11 12 13 14
my $i = 1; for my $time(sort {$a<=>$b} keys %$Signal_ref) { print"Stimestamp_"."$i : $time\n"; $i++; for my $msg(sort keys %{$Signal_ref{$time}}) { print"my signal: $msg\n"; #print"$Signal_ref{$time}\n"; } print "\n"; }
Global symbol "%Signal_ref" requires explicit package name at ... line ... .
for my $msg ( sort keys %{ $Signal_ref{$time} } )