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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.