Hi Chris, On Sun, 6 Nov 2011 07:37:26 -0600 Chris Stinemetz <chrisstinem...@gmail.com> wrote:
> 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 > }; > It's not clear what exactly you are trying to do. You may wish to refer to the links at: http://perl-begin.org/topics/references/ But you'll need to clarify your intentions. Regards, Shlomi Fish > 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 -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Apple Inc. is Evil - http://www.shlomifish.org/open-source/anti/apple/ I’m not an actor — I just play one on T.V. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/