Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I only have the locus_acc_no = printed out several times and it has no value.

Use a text editor, and do a search on $locus_acc_no. You will see it occurs 4 times in the code:

  1. my $locus_acc_no = "";
    Here it is declared and initialised to the empty string.

  2. $locus_acc_no = "";
    Here (within an if block) it is conditionally re-set to the empty string.

  3. if ($line =~ ModuleMatching::MatchLAC($locus_acc_no)) {
    Here it is passed into1 the function ModuleMatching::MatchLAC.

  4. print "locus_acc_no ", $locus_acc_no;
    Here its value is printed.

So it is never set to anything but the empty string, which is what gets printed! This is essentially the same point already made by linuxer, above. You fixed the warning but failed to address the underlying logic problem.

I don’t know anything about the ModuleMatching module, which I can’t find on CPAN, but I think it’s highly unlikely that this line:

if ($line =~ ModuleMatching::MatchLAC($locus_acc_no)) {

can be correct. But without knowing what sub ModuleMatching::MatchLAC is supposed to do, it’s hard to give advice.

Hope that helps,

1Since Perl uses pass-by-reference, it is possible that ModuleMatching::MatchLAC sets the value of $locus_acc_no; except that MatchLAC receives no information to use in determining the new value.

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

In reply to Re^3: matching problem by Athanasius
in thread matching problem by Balaton

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (8)
    As of 2018-11-21 09:42 GMT
    Find Nodes?
      Voting Booth?
      My code is most likely broken because:

      Results (238 votes). Check out past polls.