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: Questions about optmodel constraints

2010-11-21 Thread Uri Guttman
> "a" == ayaa writes: a> I have three questions: a> 1. If I have a variable that is stored in a data set and I want to a> formulate only one constraint (under optmodel) that is a function of a> all the data set's observations of this variable and a decision a> variable. Suppose the

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

Questions about optmodel constraints

2010-11-21 Thread ayaa
I have three questions: 1. If I have a variable that is stored in a data set and I want to formulate only one constraint (under optmodel) that is a function of all the data set's observations of this variable and a decision variable. Suppose the variable is a and x is the decision variable. My c

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