Re: simple hash question

2004-11-08 Thread John W. Krahn
Ing. Branislav Gerzo wrote: Hi pals, Hello, I have simple hash question, lets we have example code: my %hash = ( 1 => 2, 2 => 3, 3 => 4, 4 => 5 ); while (my($key, $value) = each(%hash)) { print "$key => $value\n"; } how I can print all values, if I want print that in th

Re: simple hash question

2004-11-08 Thread Ing. Branislav Gerzo
Edward Wijaya [EW], on Tuesday, November 09, 2004 at 03:14 (+0800) wrote: EW> use Tie::IxHash module from CPAN, to preserve order in a Hash. thanks for answer, indeed, I created small subroutine, to look... sub hash_look { while ( my ($key, $value) = each(%tab_def) ) { print "$ke

Re: simple hash question

2004-11-08 Thread Edward Wijaya
use Tie::IxHash module from CPAN, to preserve order in a Hash. Regards, Edward WIJAYA SINGAPORE On Tue, 09 Nov 2004 03:06:03 +0800, Edward Wijaya <[EMAIL PROTECTED]> wrote: On Mon, 8 Nov 2004 11:59:13 +0100, Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote: Hi pals, I have simple h

Re: simple hash question

2004-11-08 Thread Edward Wijaya
On Mon, 8 Nov 2004 11:59:13 +0100, Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote: Hi pals, I have simple hash question, lets we have example code: my %hash = ( 1 => 2, 2 => 3, 3 => 4, 4 => 5 ); while (my($key, $value) = each(%hash)) { print "$key => $value\n"; }

simple hash question

2004-11-08 Thread Ing. Branislav Gerzo
Hi pals, I have simple hash question, lets we have example code: my %hash = ( 1 => 2, 2 => 3, 3 => 4, 4 => 5 ); while (my($key, $value) = each(%hash)) { print "$key => $value\n"; } how I can print all values, if I want print that in this order: 2 => 3 4 => 5 3 =&

Simple Hash Question / NEVER MIND

2003-12-31 Thread Jeff Westman
DOH . DOH . NEVER MIND, user error ( <- gun to head) DOH . DOH . DOH . Hi I have a hash defined as my %flag3 = ( A => "DBSpace backup thread", B => "Begin work", C => "Commiting/committ

Simple Hash Question

2003-12-31 Thread Jeff Westman
Hi I have a hash defined as my %flag3 = ( A => "DBSpace backup thread", B => "Begin work", C => "Commiting/committed", H => "Heuristic aborting/aborted", P => "Preparing/prepared", R => "Aborting/aborted", X

RE: Probably a simple hash question

2003-01-24 Thread Michael Hooten
> Here's the setup: > I have set up a hash %categories where the key is one number and the value > is another > i.e. $categories('1094') = 100049-0220-14 I assume you meant (note braces and quotes): $categories{1094} = '100049-0220-14' otherwise the value will be 100049-0220-14 = -

Re: Probably a simple hash question

2003-01-23 Thread R. Joseph Newton
"Lara J. Fabans" wrote: > Hi, perl-friends,... Hi Lara, You said: > I had a while loop to search through each of the keys & values, but the problem is > that it doesn't break out of the while loop, and the wrong value gets set as $myID; Look at your words, thenlook at your code: > #while(my (

RE: Probably a simple hash question

2003-01-23 Thread Dan Muey
> Morning, Dan Morning! > > At 11:50 AM 1/23/2003 -0600, you wrote: > > > i.e. $categories('1094') = 100049-0220-14 > > > > do you mean $catagories{'1094'} ? > > Yup, I did. Never type anything in from memory :-) I can't anyway because my memory doesn't work. > > > > > value is ther

Re: Probably a simple hash question

2003-01-23 Thread Rob Dixon
Lara J. Fabans wrote: > Hi, perl-friends, > > Here's the setup: > I have set up a hash %categories where the key is one number and the > value is another > i.e. $categories('1094') = 100049-0220-14 You need quotation marks here, like this: $categories('1094') = '100049-0220-14'; othe

RE: Probably a simple hash question

2003-01-23 Thread Dan Muey
> Hi, perl-friends, > > Here's the setup: > I have set up a hash %categories where the key is one number > and the value > is another > i.e. $categories('1094') = 100049-0220-14 do you mean $catagories{'1094'} ? > > So, further on down, I'm trying to do a lookup in %categories > to see i

Probably a simple hash question

2003-01-23 Thread Lara J. Fabans
Hi, perl-friends, Here's the setup: I have set up a hash %categories where the key is one number and the value is another i.e. $categories('1094') = 100049-0220-14 So, further on down, I'm trying to do a lookup in %categories to see if a value is there. (I can swap the key and the value in