I'm not a Bio guy either so just general thoughts from me as well. Consider using strftime() from the core POSIX module to construct your date and perhaps use join rather than concatenation to form filenames.

use strict; use warnings; use POSIX qw{ strftime }; my $organism = q{WildHaggis}; my $rsite1 = q{ONE}; my $rsite2 = q{TWO}; my $rsite3 = q{THREE}; my $summaryfile = join q{_}, $organism, q{summary_doubleDigest}, $rsite1, $rsite2, $rsite3, strftime q{%m_%d_%Y.txt}, localtime( time() ); print $summaryfile, qq{\n};

This prints

WildHaggis_summary_doubleDigest_ONE_TWO_THREE_07_21_2014.txt

It is considered best practice to use lexical filehandles and the three-argument form of open and to test for success, showing the o/s error on failure, e.g.

open my $outFH, q{>}, $radtagfile or die qq{open: > $radtagfile: $!\n};

Consider using Perl-style loops rather than C-style ones. Instead of

for (my $i = 0; $i < scalar @first_fragments; ++$i)

you can write

foreach my $i ( 0 .. $#first_fragments )

I hope these pointers are helpful.

Cheers,

JohnGG


In reply to Re: Bioinformatics- Use of uninitialized value by johngg
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.