"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
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
-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 &
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
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
--- "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
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
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
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
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 (/
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
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
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
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
> -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
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
> -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' => &
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"],
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
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
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
21 matches
Mail list logo