Hash of Hashes of Arrays?

2003-01-24 Thread Glenn Tremblay
ed. It contains the following data, in order: Station Name, Address 1, Address Line 2, City, State, Zip, Phone Number I have no problem reading each of the lines and assigning variables from the output of the split(/,/, $line); This is what I need to do: I believe I need a hash of hashes of

Re: Hash of Hashes of Arrays?

2003-01-24 Thread Pete Emerson
quot;; } } } On Fri, 24 Jan 2003, Glenn Tremblay wrote: > This is what I need to do: > I believe I need a hash of hashes of arrays... > I am creating output in the format of inspection pages which list all > inspection stations in each town (some towns have only one,

Re: Hash of Hashes of Arrays?

2003-01-24 Thread Peter_Farrar
@arr = sort ${$arr[$a]}[3] <=> ${$arr[$b]}[3] @arr; # sort by city How do you picture using a hash of hashes of arrays? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Hash of Hashes of Arrays?

2003-01-24 Thread Manideepa Bhowmik
this exact code, but it should present the idea of storing this information in an array of arrays: open IN, yourfile; while (){ chomp; push @arr, \[split /,/]; } close IN; @arr = sort ${$arr[$a]}[3] <=> ${$arr[$b]}[3] @arr; # sort by c

Re: Hash of Hashes of Arrays?

2003-01-24 Thread david
Glenn Tremblay wrote: > > This is what I need to do: > I believe I need a hash of hashes of arrays... > I am creating output in the format of inspection pages which list all > inspection stations in each town (some towns have only one, others have > several). > I need t

Re: Hash of Hashes of Arrays?

2003-01-24 Thread Glenn Tremblay
On Fri, 24 Jan 2003, david wrote: > Glenn Tremblay wrote: > > > > > This is what I need to do: > > I believe I need a hash of hashes of arrays... > > I am creating output in the format of inspection pages which list all > > inspection stations in each town (s

Re: Hash of Hashes of Arrays?

2003-01-24 Thread Glenn Tremblay
On Fri, 24 Jan 2003, david wrote: > Glenn Tremblay wrote: > > > > Actually, the funny part of all this is that every station will be in the > > same state. I need to include the state information regardless. > > > > The output needs to allow me to loop through each city, somehow, and print >

Re: Hash of Hashes of Arrays?

2003-01-26 Thread Jenda Krynicky
From: Pete Emerson <[EMAIL PROTECTED]> > push @{$hash{$city}{$station}}, $add1; > push @{$hash{$city}{$station}}, $add2; > push @{$hash{$city}{$station}}, $state; > push @{$hash{$city}{$station}}, $zip; > push @{$hash{$city}{$station}}, $phone; You can push several items into an array at once: pu

Printing a hash of hashes of arrays

2009-08-27 Thread Ian
Pure beginners question. I'm creating a hash of arrays like this : $ihash{$3}{$1} = [...@itab]; For now I was able to get the data using Dumper but I need to create a "pretty" report. How do I loop over this hash/hash of arrays to print it out? Thank you. -- Ian

Re: Printing a hash of hashes of arrays

2009-08-27 Thread Jim Gibson
On 8/27/09 Thu Aug 27, 2009 10:42 AM, "Ian" scribbled: > Pure beginners question. > > I'm creating a hash of arrays like this : > > $ihash{$3}{$1} = [...@itab]; > > For now I was able to get the data using Dumper but I need to create a > "pretty" report. > > How do I loop over this hash/has

Re: Printing a hash of hashes of arrays

2009-08-27 Thread Uri Guttman
> "I" == Ian writes: I> Pure beginners question. I> I'm creating a hash of arrays like this : I> $ihash{$3}{$1} = [...@itab]; I> For now I was able to get the data using Dumper but I need to create a I> "pretty" report. I> How do I loop over this hash/hash of arrays to print i

Re: Printing a hash of hashes of arrays

2009-08-27 Thread Ian
Thank you David, Jim, Uri.

RE: Printing a hash of hashes of arrays

2009-08-28 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Ian [mailto:pcs...@gmail.com] > Sent: Thursday, August 27, 2009 11:43 > To: beginners@perl.org > Subject: Printing a hash of hashes of arrays > > Pure beginners question. > > I'm creating a hash of arrays like this :

How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
Hi; I have the following output from Data::Dumper and I want to extract the first string that the "Id" name points to. $VAR1 = [ bless( { 'Id' => [ '01tC003udXAIAY', '01tC003udXAIAY'

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Ken Slater
On Wed, Apr 13, 2016 at 9:29 PM, Kenneth Wolcott wrote: > Hi; > > I have the following output from Data::Dumper and I want to extract > the first string that the "Id" name points to. > > $VAR1 = [ > bless( { >'Id' => [ >'01tC003udXAI

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Lawrence Statton
On 04/13/2016 08:29 PM, Kenneth Wolcott wrote: Hi; I have the following output from Data::Dumper and I want to extract the first string that the "Id" name points to. $VAR1 = [ bless( { 'Id' => [ '01tC003udXAIAY',

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
On Wed, Apr 13, 2016 at 7:13 PM, Ken Slater wrote: > > On Wed, Apr 13, 2016 at 9:29 PM, Kenneth Wolcott > wrote: >> >> Hi; >> >> I have the following output from Data::Dumper and I want to extract >> the first string that the "Id" name points to. >> >> $VAR1 = [ >> bless( { >>

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
Hello Kenneth, Check this out: use v5.22; use Data::Dumper; my $VAR1; $VAR1 = [ bless( { 'Id' => [ '01tC003udXAIAY', '01tC003udXAIAY' ], 'type' => 'Product2'

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
Hello Kenneth, Check this out: use v5.22; use Data::Dumper; my $VAR1; $VAR1 = [ bless( { 'Id' => [ '01tC003udXAIAY', '01tC003udXAIAY' ], 'type' => 'Product2'

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Shlomi Fish
Hello Raj, On Thu, 14 Apr 2016 03:52:56 + Raj Barath wrote: > Hello Kenneth, > > Check this out: > > use v5.22; > use Data::Dumper; > > my $VAR1; > > $VAR1 = [ > bless( { >'Id' => [ >'01tC003udXAIAY', >

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Aaron Wells
Hi Kenneth, Welcome aboard (for the nth time)! The replies on this thread have been helpful, but they haven’t really addressed the underlying issue, which is that there’s subscripting, then there’s dereferencing. I’ll try to keep my explanation brief, but first a solution: $confused = [ bl

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
I was wrong. Please don't use my example. Aaron wells explanation is perfect. Apologies for the confusion. -Raj On Thu, Apr 14, 2016 at 11:15 AM, Aaron Wells mailto:chacewe...@gmail.com>> wrote: Hi Kenneth, Welcome aboard (for the nth time)! The replies on this thread have been helpful, but

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
I was wrong. Please don't use my example. Aaron wells explanation is perfect. Apologies for the confusion. -Raj On Thu, Apr 14, 2016 at 11:15 AM, Aaron Wells mailto:chacewe...@gmail.com>> wrote: Hi Kenneth, Welcome aboard (for the nth time)! The replies on this thread have been helpful, but

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-15 Thread Shlomi Fish
Hi Raj, On Thu, 14 Apr 2016 16:15:08 + Raj Barath wrote: > I was wrong. Please don't use my example. > Aaron wells explanation is perfect. > Thanks for admitting you were wrong - many people fail to do so. I agree that Aaron Wells's explanation appears to be very good, and one can find mor