Trouble with $key to HASH when Numeric
From: CowBoyCraig (simpsonc_at_us.ibm.com)
Date: 03/04/05
- Next message: Wiseguy: "question about sort()"
- Previous message: Joe Smith: "Re: interactive mode ` ` in perl script"
- Next in thread: Joe Smith: "Re: Trouble with $key to HASH when Numeric"
- Reply: Joe Smith: "Re: Trouble with $key to HASH when Numeric"
- Reply: Jim Gibson: "Re: Trouble with $key to HASH when Numeric"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Mar 2005 20:26:34 -0800
It seems if I "Change" the $key going to if ""(exists($GREEN{$key}))""
at all It hoses. The keys look like "19973|3.1.A.4" without the quotes.
If I print like this "print GREEN{$key}\n"; to see what the Hash is
getting it looks like this:
}REEN{12483|3.1.B.2
That is odd? Is there a way to send my data to the hash without it
getting hosed???
Code below:
foreach (keys %HOT) {
# 6AE-23945: 4.1.B.6 # Fix this
# Make a Key for %GREEN from %HOT that works
my $i=$_;
$i=~/(\d{5}?)$/g;
$i=$1;
my $key="$i|$HOT{$_}";
#print "$GREEN{$key}\n";
if (exists($GREEN{$key})) {
# Remove from %GREEN
# remove $KEY and its value from %HASH
print "Removed $GREEN{$key}\n";
delete($GREEN{$key});
} else { # print "did not see\n";
}
}
Craig
- Next message: Wiseguy: "question about sort()"
- Previous message: Joe Smith: "Re: interactive mode ` ` in perl script"
- Next in thread: Joe Smith: "Re: Trouble with $key to HASH when Numeric"
- Reply: Joe Smith: "Re: Trouble with $key to HASH when Numeric"
- Reply: Jim Gibson: "Re: Trouble with $key to HASH when Numeric"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|