Re: complex data structure

2011-11-14 Thread Shlomi Fish
On Mon, 14 Nov 2011 23:06:15 -0600 Chris Stinemetz wrote: > Thank you Shlomi. > > For some reason my final value for the keys is being repeated 24 times so I > am guessing I have an issue with how I am iterating over the hashes. > > I can't seem to find the correct way to fix it so the value di

Re: complex data structure

2011-11-14 Thread Chris Stinemetz
Thank you Shlomi. For some reason my final value for the keys is being repeated 24 times so I am guessing I have an issue with how I am iterating over the hashes. I can't seem to find the correct way to fix it so the value displays once. Any help is greatly appreciated. An example of the output

Re: complex data structure

2011-11-13 Thread Shlomi Fish
Hi Chris, On Mon, 14 Nov 2011 00:31:19 -0600 Chris Stinemetz wrote: [SNIP] > # header > print "HOUR\tCELL\tHEH_TYPE\tHEH_COUNT\n"; > # body > foreach my $hour (sort {$a <=> $b} keys %CELL){ > foreach my $cellNo (sort {$a <=> $b} keys %{$CELL{$hour}}) { > print "$hour\t $cellNo\t"; > f

Re: complex data structure

2011-11-13 Thread Chris Stinemetz
How can I iterate over this three level hash printing the results as Hour\tCell\tHEH_Type\HEH_Count $VAR1 = { '00' => { '875' => { 'CDM 1, CCU 1, CE 5' => '1' }, '13' => {

Re: complex data structure

2011-11-06 Thread Jim Gibson
At 7:37 AM -0600 11/6/11, Chris Stinemetz 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 }, %cell is a two-level hash with two keys needed to get to

Re: complex data structure

2011-11-06 Thread Shlomi Fish
Hi Chris, On Sun, 6 Nov 2011 07:37:26 -0600 Chris Stinemetz 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 lo

complex data structure

2011-11-06 Thread Chris Stinemetz
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'=>{

Re: complex data structure

2005-01-11 Thread Ing. Branislav Gerzo
[EMAIL PROTECTED] [m], on Monday, January 10, 2005 at 13:23 (-0500) made these points: mon> I can try, I personaly perfer RoHoH..., looks like you have RoHoAoH thanks, maybe I will change that to RoHoH, I'd like to insert those values to database, where keys will be name of columns. -- ...m8s

Re: complex data structure

2005-01-10 Thread John W. Krahn
Ing. Branislav Gerzo wrote: Hi pals, Hello, How can I add values to hash, when key is the same ? Example: my %ha = ( 'test1' => [ { 'test1_a' => 'a', 'test1_b' => 'b', }, {

Re: complex data structure

2005-01-10 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Chris Charley" <[EMAIL PROTECTED]> Cc: Sent: Monday, January 10, 2005 1:23 PM Subject: Re: complex data structure - Original Message - From: Chris Charley <[EMAIL PROTECTE

Re: complex data structure

2005-01-10 Thread mgoland
- Original Message - From: Chris Charley <[EMAIL PROTECTED]> Date: Monday, January 10, 2005 12:59 pm Subject: Re: complex data structure > I hope someone can explain this related question. When I run the > code below I can try, I personaly perfer RoHoH..., looks like you

Re: complex data structure

2005-01-10 Thread Chris Charley
I hope someone can explain this related question. When I run the code below on Brano's data structure, 'each' gives me false results but 'keys' gives me correct results. I'm kind of stumped! #!/usr/bin/perl use strict; use warnings; my $hash = { 'test1' => [ {

Re: complex data structure

2005-01-10 Thread Ing. Branislav Gerzo
Moon, John [MJ], on Monday, January 10, 2005 at 07:31 (-0500) made these points: MJ> Hope this helps .. thanks a lot for your time, I appreciate that! -- ...m8s, cu l8r, Brano. [Rifles don't pick up the phone in the middle of a down load] -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: complex data structure

2005-01-10 Thread Ing. Branislav Gerzo
Ing. Branislav Gerzo [IBG], on Monday, January 10, 2005 at 13:03 (+0100) thinks about: IBG> How can I add values to hash, when key is the same ? Example: I am answering to myself: writing own code should be complex, why not to use module for that? try a look at: http://search.cpan.org/~mneylon/H

RE: complex data structure

2005-01-10 Thread Moon, John
Subject: complex data structure Hi pals, How can I add values to hash, when key is the same ? Example: my %ha = ( 'test1' => [ { 'test1_a' => 'a',

complex data structure

2005-01-10 Thread Ing. Branislav Gerzo
Hi pals, How can I add values to hash, when key is the same ? Example: my %ha = ( 'test1' => [ { 'test1_a' => 'a', 'test1_b' => 'b', }, { 'test1_a

Re: Confused by a complex data structure

2002-12-15 Thread John W. Krahn
Rob Richardson wrote: > > Hello again. Hello, > None of this is working. > > John Krahn suggested: > > push @{$trainsList{$trainDate}}, @trainData; > (note the curly brackets on the outside). This gave me the following > error: > > Can't locate object method "trainList" via package "train

Re: Confused by a complex data structure

2002-12-15 Thread Rob Richardson
Hello again. None of this is working. John Krahn suggested: > push @{$trainsList{$trainDate}}, @trainData; (note the curly brackets on the outside). This gave me the following error: Can't locate object method "trainList" via package "trainDate" (perhaps you forgot to load "trainDate"?) at

Re: Confused by a complex data structure

2002-12-15 Thread John W. Krahn
Rob Richardson wrote: > > Greetings! Hello, > I am trying to write a Perl script for the Cuyahoga Valley Scenic > Railroad, so that volunteers can sign up to work on trains. The > schedule file has comma-separated lines that have the date of the > train, the name of the train, and the names of

RE: Confused by a complex data structure

2002-12-14 Thread Beau E. Cox
sed by a complex data structure Greetings! I am trying to write a Perl script for the Cuyahoga Valley Scenic Railroad, so that volunteers can sign up to work on trains. The schedule file has comma-separated lines that have the date of the train, the name of the train, and the names of people

Confused by a complex data structure

2002-12-14 Thread Rob Richardson
Greetings! I am trying to write a Perl script for the Cuyahoga Valley Scenic Railroad, so that volunteers can sign up to work on trains. The schedule file has comma-separated lines that have the date of the train, the name of the train, and the names of people who will be working on the train (or

RE: Syntax problems with complex data structure

2001-12-26 Thread Bob Showalter
> -Original Message- > From: John W. Brooking IV [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 26, 2001 10:16 AM > To: [EMAIL PROTECTED] > Subject: Syntax problems with complex data structure > > > Readers, > > I hope you all have had or are ha

Syntax problems with complex data structure

2001-12-26 Thread John W. Brooking IV
Readers, I hope you all have had or are having happy holidays of your tradition. I'm trying to build up a complex data structure from a file, and cannot figure out the right syntax for accessing it afterwards. O'Reilly's "Programming Perl" has been very helpful in s