Raksha Jalan has asked for the wisdom of the Perl Monks concerning the following question:
I am beginner in perl. I am reading word pairs from text file in [['treatments', 'sunlight'], ['treatments', 'help'],...] format. I am reading it using perl .But after doing lot of pre-processing so that $umls->getConceptList($t1); get string .But its still showing same error.Dont know what is wrong with syntax or is there something else i m missing...
#**************problem in below line**** my $cu1 = $umls->getConceptList($t1);
(Instead of passing $t1="$w[0]",$t2="$w[1]" if I pass string like $t1="Medicine",$t2= "head" directly then it works perfectly fine. Dont know whats problem with assignment of $t1,$t2. Please help me to resolve it.....
******CODE************** for(my $i=0;$i<$n_size;$i++){ my @w= split(/,/ , $new[$i]); $w[0]=~s/\'//; #pre-process to remove ' from text $w[0]=~s/\'//; as @w='word1' 'word2' $w[1]=~s/\'//; $w[1]=~s/\'//; my $t1 = "$w[0]"; #$w[0]=word1 without single quotes my $t2 = "$w[1]"; #$w[1]=word2 print $t1,$t2,"__________"; #working my $cu1 = $umls->getConceptList($t1); #calling function from umls +::similarity #ERRRO 1 as mentioned my $cui1 =pop @{$cu1}; my $cu2 = $umls->getConceptList($t2);***error my $cui2 = pop @{$cu2}; print $cui1; # ****ERROR2 unintialized $cui1 my $lvalue = $lch->getRelatedness($cui1, $cui2); my $value = $path->getRelatedness($cui1, $cui2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use of uninitialized value $cui1 in print
by huck (Prior) on Mar 03, 2017 at 05:20 UTC | |
by AnomalousMonk (Archbishop) on Mar 03, 2017 at 05:38 UTC | |
by Raksha Jalan (Initiate) on Mar 03, 2017 at 09:50 UTC | |
by AnomalousMonk (Archbishop) on Mar 03, 2017 at 10:29 UTC | |
by huck (Prior) on Mar 03, 2017 at 14:53 UTC | |
|
Re: Use of uninitialized value $cui1 in print
by Raksha Jalan (Initiate) on Mar 02, 2017 at 16:59 UTC | |
by AnomalousMonk (Archbishop) on Mar 02, 2017 at 19:58 UTC | |
by Raksha Jalan (Initiate) on Mar 03, 2017 at 03:44 UTC | |
by AnomalousMonk (Archbishop) on Mar 03, 2017 at 05:12 UTC |