Re: Hashes from files. Unable to access values. Please, please help.

2010-11-23 Thread addie
> Where did $var come from? Sorry about that. That was a left over from the actual code that I tried to pare down to be a small example. Messed that up as badly as the copy/paste of the code made it really very ugly. Addie -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Uri Guttman
> "JWK" == John W Krahn writes: JWK> Uri Guttman wrote: >>> "a" == addie writes: >> a> %hash = split(/\s/, $locus_line); >> >> that assigns a single pair to the hash. a SINGLE PAIR to the WHOLE >> HASH. anything in the hash before that is wiped out. also the values >> w

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Rob Dixon
On 21/11/2010 09:56, addie wrote: I have been fighting with this problem for over a week now he really aggravating thing is that I had it working for over a year without problem. have tried everything I can imagine. I've cut the code down to a toy version to isolate the problem and it is no help

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread John W. Krahn
Uri Guttman wrote: "a" == addie writes: a> %hash = split(/\s/, $locus_line); that assigns a single pair to the hash. a SINGLE PAIR to the WHOLE HASH. anything in the hash before that is wiped out. also the values will have newlines on them which isn't the main bug but is usually wrong

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> On 10-11-21 12:49 PM, Uri Guttman wrote: a> my %hash = (); >> >> no need to initialize a lexical hash with (). SHC> Sorry but you should initialize all your variables. At one time SHC> mod_perl did not initialize the data space; it simply r

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Uri Guttman
> "a" == addie writes: a> #!/usr/bin/ a> perl a> \ that is VERY strange line wrapping. please be careful how you paste code so it doesn't do that. readers can't then paste the code and run it without cleaning up the wrapped lines. a> use strict; a> use warnings; a> my %hash =

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Shawn H Corey
On 10-11-21 12:49 PM, Uri Guttman wrote: a> my %hash = (); no need to initialize a lexical hash with (). Sorry but you should initialize all your variables. At one time mod_perl did not initialize the data space; it simply re-used it. So your variables started with whatever was in them

Re: Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread Shawn H Corey
On 10-11-21 04:56 AM, addie wrote: #!/usr/bin/ perl \ use strict; use warnings; my %hash = (); my $key = ''; open ACCESSIONS, "fix.txt" or die "Can't open fix.txt: $!\n"; while (my $locus_line =){ #This is supposed to populate %hash. %hash = split(/\s/, $locus_line); foreach my $k (ke

Hashes from files. Unable to access values. Please, please help.

2010-11-21 Thread addie
I have been fighting with this problem for over a week now he really aggravating thing is that I had it working for over a year without problem. have tried everything I can imagine. I've cut the code down to a toy version to isolate the problem and it is no help. For the sake of this issue let's s