in reply to Bioinformatics- Use of uninitialized value
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
|
|---|