I'm not a bio-guy, so just some general thoughts.

... error: Use of uninitialized value $_ in pattern match (m//) at /Users/.../Triple.pl line 66.

This is not an error, but a warning. Warnings are enabled by use-ing the warnings pragma, which the script you posted does not do. I don't see how you could get the quoted warning from the posted code (update: unless you're using the  -w command-line switch to invoke your script — Ah-ha, I see it now in the shebang invocation: strike this comment).

c:\@Work\Perl\monks>perl -MData::Dump -le "use strict; ;; my $rx = 'x'; my @ra = grep !/$rx/, undef; dd \@ra; " [undef] c:\@Work\Perl\monks>perl -MData::Dump -le "use strict; use warnings; ;; my $rx = 'x'; my @ra = grep !/$rx/, undef; dd \@ra; " Use of uninitialized value $_ in pattern match (m//) at -e line 1. [undef]

my @third_fragments = grep !/$rsite3/, $second_fragments[$i];

grep operates on a list, but this statement has a list consisting only of the  $second_fragments[$i] scalar, i.e., a single item. The  @third_fragments array can then be initialized with only zero or one elements. I don't know if this was intended. Further, I don't offhand see any reason the  @second_fragments array must contain  $i + 1 elements; thus, you may be accessing an element that's "off the end" of the array and therefore undefined.

Update: Finally saw  -w in shebang invocation, so strike entire first 'thought'.


In reply to Re: Bioinformatics- Use of uninitialized value by AnomalousMonk
in thread Bioinformatics- Use of uninitialized value by mlsmit10

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.