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);
In reply to Use of uninitialized value $cui1 in print by Raksha Jalan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |