Re: hash of hashes question

2009-09-04 Thread Noah Garrett Wallach
Patrick Dupre wrote: On Fri, 4 Sep 2009, Noah Garrett Wallach wrote: Hi there, I am having some trouble understanding hash of hashes here. I want to find all the keys for %policy{'policy_statement'} for my $line (@lines) { for my $key ( keys %policy{'policy_statement'} ) { Ch

Re: hash of hashes question

2009-09-04 Thread Patrick Dupre
On Fri, 4 Sep 2009, Noah Garrett Wallach wrote: Hi there, I am having some trouble understanding hash of hashes here. I want to find all the keys for %policy{'policy_statement'} for my $line (@lines) { for my $key ( keys %policy{'policy_statement'} ) { Check if $keys is correc

Re: hash of hashes question

2009-09-04 Thread Jim Gibson
At 11:02 AM -0700 9/4/09, Noah Garrett Wallach wrote: Hi there, I am having some trouble understanding hash of hashes here. I want to find all the keys for %policy{'policy_statement'} for my $line (@lines) { for my $key ( keys %policy{'policy_statement'} ) { %policy is a hash

hash of hashes question

2009-09-04 Thread Noah Garrett Wallach
Hi there, I am having some trouble understanding hash of hashes here. I want to find all the keys for %policy{'policy_statement'} for my $line (@lines) { for my $key ( keys %policy{'policy_statement'} ) { if ($line =~ /set\sprotocols\sbgp\sgroup\s(\S+)\s(import|exp

Re: Anonymous array of hashes question

2005-08-04 Thread John W. Krahn
Jason Normandin wrote: > Hello Hello, > I have a situation where I build an anonymous array of hashes for some > requests and responses found in a file (there can be multiple requests and > responses). It works very nicely and tracks all of the responses and > requests from an ip to another IP ad

Re: Anonymous array of hashes question

2005-08-04 Thread Philipp Traeder
On Friday 05 August 2005 01:37, Jason Normandin wrote: [..] > > if ($protocol =~ /PING REQUEST/) { > push @{$pingRequests{$destination}}, { > time => $time, > sequenceNumber=>$sequenceNumber > }; > } > elsif ($protocol =~ /PING RESPONSE/) { > push @{$pi

Anonymous array of hashes question

2005-08-04 Thread Jason Normandin
Hello I have a situation where I build an anonymous array of hashes for some requests and responses found in a file (there can be multiple requests and responses). It works very nicely and tracks all of the responses and requests from an ip to another IP address. Here is my code: my $time=$1 if

Re: Help needed: Simple HASHES question

2003-04-05 Thread Ciprian Morar
sorry for the spam - my question has been answered Hotmail was filtering the discussion list. C 1. What is the difference between Line #1 and Line #2? 2. Why is the Line #2 declaration incorrect? use strict; my %option; $option {'q'} = new CGI; #Line 1- $option{'Mon'} = 'Monday

Help needed: Simple HASHES question

2003-04-05 Thread Ciprian Morar
1. What is the difference between Line #1 and Line #2? 2. Why is the Line #2 declaration incorrect? use strict; my %option; $option {'q'} = new CGI; #Line 1- $option{'Mon'} = 'Monday'; #Line 2 - $option->{'Tue'} = 'Tuesday'; print $option{'q'} -> header(), $

Re: need help - simple HASHES question

2003-04-04 Thread John W. Krahn
Ciprian Morar wrote: > > 1. What is the difference between Line #1 and Line #2? > 2. Why is the Line #2 declaration incorrect? > > use strict; > > my %option; > $option {'q'} = new CGI; > > #Line 1- > $option{'Mon'} = 'Monday'; > > #Line 2 - > $option->{

need help - simple HASHES question

2003-04-04 Thread Ciprian Morar
1. What is the difference between Line #1 and Line #2? 2. Why is the Line #2 declaration incorrect? use strict; my %option; $option {'q'} = new CGI; #Line 1- $option{'Mon'} = 'Monday'; #Line 2 - $option->{'Tue'} = 'Tuesday'; print $option{'q'} -> header(), $

Re: Hashes Question : Thank you

2002-11-27 Thread Sudarshan Raghavan
On Wed, 27 Nov 2002, Ben Crane wrote: > Cheers, > > I was going to think about using a hash for a text > file that contains information from a > file::find...there are thousands and thousands of > files I want to x-check and update it the modified > date differs...at the moment, arrays work fine

Re: Hashes Question : Thank you

2002-11-27 Thread Ben Crane
Cheers, I was going to think about using a hash for a text file that contains information from a file::find...there are thousands and thousands of files I want to x-check and update it the modified date differs...at the moment, arrays work fine, but I was hoping a hash would mean a slightly quick

Re: Hashes Question!

2002-11-27 Thread Sudarshan Raghavan
On Wed, 27 Nov 2002, Ben Crane wrote: > Hi all, > > One quick Q about hashes: > > they contain a key and data? > e.g: %stuff=(A => 'one', > B => 'two'); > > where A and B are keys to data one and two...but what > happens if you have a massive text file wher you had > one key, but 2

Re: Hashes Question!

2002-11-27 Thread Jenda Krynicky
From: Ben Crane <[EMAIL PROTECTED]> > Hi all, > > One quick Q about hashes: > > they contain a key and data? > e.g: %stuff=(A => 'one', > B => 'two'); > > where A and B are keys to data one and two...but what > happens if you have a massive text file wher you had > one key, but 20 o

Hashes Question!

2002-11-27 Thread Ben Crane
Hi all, One quick Q about hashes: they contain a key and data? e.g: %stuff=(A => 'one', B => 'two'); where A and B are keys to data one and two...but what happens if you have a massive text file wher you had one key, but 20 or 30 columns of data? do you do this: %stuff=(A => 'one',

Hashes Question!

2002-11-27 Thread Ben Crane
Hi all, One quick Q about hashes: they contain a key and data? e.g: %stuff=(A => 'one', B => 'two'); where A and B are keys to data one and two...but what happens if you have a massive text file wher you had one key, but 20 or 30 columns of data? do you do this: %stuff=(A => 'one',