Re: Trouble with $key to HASH when Numeric
From: Joe Smith (joe_at_inwap.com)
Date: 03/04/05
- Previous message: Jim Gibson: "Re: question about sort()"
- In reply to: CowBoyCraig: "Trouble with $key to HASH when Numeric"
- Next in thread: Jim Gibson: "Re: Trouble with $key to HASH when Numeric"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 04 Mar 2005 10:55:42 -0800
CowBoyCraig wrote:
> 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.
Based on your problem, I can see that they are not what you think.
> 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 to be expected when you print a value like "12483|3.1.B.2\r\n".
You did not use chomp() or other means to get rid of the
unwanted carriage return at the end of the line.
Next time, post to comp.lang.perl.misc instead of comp.lang.perl .
-Joe
- Previous message: Jim Gibson: "Re: question about sort()"
- In reply to: CowBoyCraig: "Trouble with $key to HASH when Numeric"
- Next in thread: Jim Gibson: "Re: Trouble with $key to HASH when Numeric"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]