Re: Hash problem

2006-09-28 Thread Dr.Ruud
"Johnson, Reginald (GTI)" schreef: > I guess it > is a good practice to use data::dumper when you are developing > programs. ITYM: Data::Dumper (casing matters). -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: Hash problem

2006-09-28 Thread D. Bolliger
Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 22:56: > I guess it > is a good practice to use data::dumper when you are developing programs. What you should always use is (as others pointed out) the lines: use strict; use warnings; to improve detection of errors. Data::Dumper is use

RE: Hash problem

2006-09-28 Thread Johnson, Reginald \(GTI\)
-Original Message- From: D. Bolliger [mailto:[EMAIL PROTECTED] Sent: Thursday, September 28, 2006 4:32 PM To: beginners@perl.org Subject: Re: Hash problem Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 21:58: > I am doing an example from Perl Objects, References &

Re: Hash problem

2006-09-28 Thread John W. Krahn
Johnson, Reginald (GTI) wrote: > I am doing an example from Perl Objects, References & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name and I'm not sure > why. Here is my output. > > this is person=>HASH(0x20040014) > thi

Re: Hash problem

2006-09-28 Thread D. Bolliger
Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 21:58: > I am doing an example from Perl Objects, References & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name and I'm not sure > why. Here is my output. > > this

Re: Hash problem

2006-09-28 Thread chen li
--- "Johnson, Reginald (GTI)" <[EMAIL PROTECTED]> wrote: > I am doing an example from Perl Objects, References > & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name > and I'm not sure > why. Here is my output. > > this

RE: Hash problem

2006-02-15 Thread Timothy Johnson
You can try making a hash of names out of file C (just set $hash{$name} = 1;), and then just check each name with unless($hash{$name}){ do something... } -Original Message- From: Andrej Kastrin [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 15, 2006 8:29 AM To: beginner

Re: Hash problem

2006-01-31 Thread Andrej Kastrin
John W. Krahn wrote: Andrej Kastrin wrote: Dear all, Hello, I have bar separated file: name1|345 name2|201 ... I store it into a hash; while () { chomp; ($name,$score) = split (/\|/,$_); $hash{$name} = $score; } Then I have second file: ID - 001 NA - name1 NA - name2 ID - 0

Re: Hash problem

2006-01-30 Thread John W. Krahn
Andrej Kastrin wrote: > Dear all, Hello, > I have bar separated file: > name1|345 > name2|201 > ... > > I store it into a hash; > while () { > chomp; > ($name,$score) = split (/\|/,$_); > $hash{$name} = $score; > } > > Then I have second file: > ID - 001 > NA - name1 > NA - name2 > > ID

Re: Hash problem

2006-01-30 Thread John Doe
Andrej Kastrin am Montag, 30. Januar 2006 16.50: > John Doe wrote: > >Andrej Kastrin am Montag, 30. Januar 2006 10.14: > >>Dear all, > >> > >>I have bar separated file: > >>name1|345 > >>name2|201 > >>... > >> > >>I store it into a hash; > >>while () { > >> chomp; > >> ($name,$score) = split (/

Re: Hash problem

2006-01-30 Thread Andrej Kastrin
John Doe wrote: Andrej Kastrin am Montag, 30. Januar 2006 10.14: Dear all, I have bar separated file: name1|345 name2|201 ... I store it into a hash; while () { chomp; ($name,$score) = split (/\|/,$_); $hash{$name} = $score; } Let's assume the resulting hash is %scores. T

Re: Hash problem

2006-01-30 Thread John Doe
Andrej Kastrin am Montag, 30. Januar 2006 10.14: > Dear all, > > I have bar separated file: > name1|345 > name2|201 > ... > > I store it into a hash; > while () { >chomp; >($name,$score) = split (/\|/,$_); >$hash{$name} = $score; > } Let's assume the resulting hash is %scores. > Then

RE: Hash Problem

2005-09-25 Thread Jeff 'japhy' Pinyan
On Sep 23, Ryan Frantz said: From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] foreach my $process (in $sobj->InstancesOf("Win32_LogicalDisk")) { next if $ignoreDriveTypes{ $process->{DriveType} }; So this would evaluate to true if $process->{DriveType} matches a key in the hash? It wo

Re: Hash Problem

2005-09-23 Thread John W. Krahn
Ryan Frantz wrote: > Perlers, Hello, > I'm working on a small script that checks the free space on local fixed > drives on my system. Since there other drive types (i.e. floppy, > CD-ROM, network maps) I want to exclude those. I decided to use a hash > but the script still displays all of the d

RE: Hash Problem

2005-09-23 Thread Ryan Frantz
> -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] > Sent: Friday, September 23, 2005 3:45 PM > To: Ryan Frantz > Cc: beginners perl > Subject: Re: Hash Problem > > On Sep 23, Ryan Frantz said: > > > I'm working

Re: Hash Problem

2005-09-23 Thread Jeff 'japhy' Pinyan
On Sep 23, Ryan Frantz said: I'm working on a small script that checks the free space on local fixed drives on my system. Since there other drive types (i.e. floppy, CD-ROM, network maps) I want to exclude those. I decided to use a hash but the script still displays all of the drives on my sys

RE: Hash Problem

2005-09-23 Thread Ryan Frantz
> -Original Message- > From: Bakken, Luke [mailto:[EMAIL PROTECTED] > Sent: Friday, September 23, 2005 3:26 PM > To: Ryan Frantz > Subject: RE: Hash Problem > > Ryan Frantz wrote: > > > my %ignoreDriveTypes = ( > > 'floppy' => &

Re: Hash problem

2004-12-26 Thread Mike Blezien
Randy W. Sims wrote: Mike Blezien wrote: Hello, I'm working on settup a hash something like this: my $catid = 'A'; my(%conf); $conf{cat} = { A => ( ["15.00","Three months(90days)","90"], ["30.00","Six months(180 days)","180"],

Re: Hash problem

2004-12-26 Thread Randy W. Sims
Mike Blezien wrote: Hello, I'm working on settup a hash something like this: my $catid = 'A'; my(%conf); $conf{cat} = { A => ( ["15.00","Three months(90days)","90"], ["30.00","Six months(180 days)","180"], ["4

Re: HASH PROBLEM!!

2003-06-20 Thread david
Eric Walker wrote: > I have a check I am doing with a hash. > > if (exists $deref{$drcrule}) > > > This check fails as if the keyvalue is a part of the hash, but when I > print out the keys like this > foreach my $item (%{$deref}){ > print "$item\n"; > } > > And it is not in the list. I ran

RE: HASH PROBLEM!!

2003-06-20 Thread Gupta, Sharad
Somewhere in the "perldoc -f exists" i read: Although the deepest nested array or hash will not spring into existence just because its existence was tested, any intervening ones will. Thus