OK,I've checked the exit values of all of the components of the script and they all exit with a status of 0. However, when trying to make my script smaller, I realized that it works fine if I simply have the first subroutine print a txt file. So it seems to me that the issue has to due with this subroutine:

sub rep_set{ open(FILE, "Superior_seqs2.txt") ||die; $/=">"; my%hash=(); my$hashref=\%hash; while(<FILE>){ if($_ =~ /^(.+?)\((\d+)\)(.+)\n(.+)/){ my$site=$1;my$count=$2;my$qiime=$3;my$seq=$4; $hashref -> {$seq}{$site}=$count; }else{ print "ERROR!\n" } } open (TABLE, ">>OTU_TABLE.txt")||die; open (REP,">>rep_set.txt")||die; my$seq_label=0; for my$seq_key(keys %hash){ $seq_label++; print REP ">$seq_label\n$seq_key\n"; print TABLE ">$seq_label\t"; for my$site_key(keys %{$hash{$seq_key}}){ my$counts="$hash{$seq_key}{$site_key}"; #print "$counts\n"; for(my$i=0;$i<=$counts;$i++){ print TABLE "$site_key\t"; } } print TABLE "\n"; } close FILE;close TABLE;close REP; }

The file that is being opened has the following format:

>ZZ2(12)orig_bc=GTAGCAACGTC new_bc=GTAGCAACGTC bc_diffs=0 TACGAAGGGACCTAGCGTAGTTCGGAATTACTGGGCGTAAAGCGCGCGTAGGCCGTTGAGTTAGTTAATT +GTGAAATCCCAAAGCTTAACTTTGGAACTGCAATTAAAACTGCTCGACTAGAGTTTGATAGAGGAAAGC +GGAATACATAGTGTAGAGGTGAAATTCGTAGATATTATGTAGAGCACCAGTTGCGAAGGCGGCTTTCTG +GATCAACACTGACGCTGAGGCGCGAAAGTATGGGTAGCAAAGAGG >ZZ2(6)orig_bc=GTAGCAACGTC new_bc=GTAGCAACGTC bc_diffs=0 TACGAAGGGACCTAGCGTAGTTCGGAATTACTGGGCGTAAAGCGCGCGTAGGCCGTTGAGTTAGTTAATT +GTGAAATCCCAAAGCTTAACTTTGGAACTGCAATTAAAACTGCTCGACTAGAGTTTGATAGAGGAAAGC +GGAATACATAGTGTAGAGGTGAAATTCGTAGATATTATGTAGAACACCAGTTGCGAAGGCGGCTTTCTG +GATCAACACTGACGCCGAGGCGCGAAAGTATGGGTAGCAAAGAGG >ZZ2(15)orig_bc=GTAGCAACGTC new_bc=GTAGCAACGTC bc_diffs=0 TACGTAGGGACCTAGCGTAGTTCGGAATTACTGGGCGTAAAGCGCGCGTAGGCCGTTGAGTTAGTTAATT +GTGAAATCCCAAAGCTTAACTTTGGAACTGCAATTAAAACTGCTCGACTAGAGTTTGATAGAGGAAAGC +GGAATACATAGTGTAGAGGTGAAATTCGTAGATATTATGTAGAACACCAGTTGCGAAGGCGGCTTTCTG +GATCAACACTGACGCTGAGGCGCGAAAGTATGGGTAGCAAAGAGG

it has ~39,000 entries


In reply to Re^2: system() issue by Anonymous Monk
in thread system() issue by Anonymous Monk

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.