I would like to join the key from %cell hash to %cbr hash

the dump from %cell hash looks like:

          '65' => {
                    'CDM 1, 2, CBR 3, 15MHz' => 2
                  },
and the dump from %cbr looks like:

$VAR1 = {
          '1' => 223,
        };
So that %cbr becomes:

'65'=>{
    '1'=>3
     };

The portion of code that I am trying to complete this task is below. I'm
still learning complex data structures so please forgive my question if it
seems awkward.

my %cell;
my %heh_type_count;
my %cbr;
my $timeStamp;
my $hour;
while (my $line = <$FIN>){
  if ($line =~ m|\d{1,2}/\d{1,2}/\d{2} ((\d{1,2}):\d{1,2}:\d{1,2})|){
    $timeStamp = $1;
    $hour = $2;
  }
  if ($line =~ /CELL\s*(\d+)\s*(.*),\s*HEH/){
    if ((0 <=$hour)&&($hour <=23)){
      $cell{$1}{$2}++;
      $heh_type_count{$2}++;
      if ($2 =~ /CBR\s*(\d+)/){
        $cbr{$1}++; ## this is where I would like to join so the key from
%cell is present.
      }
    }
  }
}
print Dumper \%cell;
print Dumper \%cbr;
print Dumper \%heh_type_count;

Thank you,

chris

Reply via email to