quick question: why script goes out of the loop and exit if it finds a null value for $p_value? How can I fix it? | [reply] |
I'm a little surprised that the loop exits on null values, but the fix is easy. When used in a logical context, null values and zeros evaluate to false. The easy solution is to test values with the defined function in place of just testing the value ( i.e. replace while (my $data_ref = $csv->getline($fh)) with while (defined(my $data_ref = $csv->getline($fh))) ). This will only return false if the value in the tested variable is undef.
| [reply] [d/l] [select] |
mmm, I guess that was not the problem. The text file that I am prcessing is very larg, it has over 8 million lines and the utterance that scripts aborts at(without any error message)is at line 43,100. The only unusual thing that I noticed first near the last utterance processed was that the column in front of p ($p_value) was empty. The last utterance was "History of present illness:" my nlp software (MMTX) prases it into three phrases : "History","of present illness" and "" which is actaully the punctuation":" First I thought ":" is the problem but apparently it is not since there are multiple instances before this one from the very first lines.
Do you think this is a size/buffer issue?
| [reply] |