title: Change the identifier line name to random shortened name in fasta file
body: <p>I have a fasta file with about 8,000 sequences in it. I need to change the  identifier line name to a random unique shorten name (max length 10). 
  The fasta file contains seqences like this.</p>
  
  <pre><code>&gt;AX039539.1.1212 Bacteria;Chloroflexi;Dehalococcoidia;Dehalococcoidales;
  GAUGAACGCUAGCGGCGUGCCUUAUGCAUGCAAGUCGAACGGUCUUAAGCAAUUAAGAUAGUGGCAAACGGGUGAGUAACGCGUAAGUAACCUACCUCUAAGUGGGGGAUAGCUUCGGGAAACUGAAGGUAAUACCGCAUGUGGUGGGCCGACAUAAGUUGGUUCACUAAAGCCGUAAGGUGCUUGGUGAGGGGCUUGCGUCCGAUUAGCUAGUUGGUGGGGUAACGGCCUACCAAGGCUUCGAUCGGUAGCUGGUCUGAGAGGAUGAUCAGCCACACUGGGACUGAGACACGGCCCAGACUCCUACGGGAG
  </code></pre>
  
  <p>Here is my script so far:</p>
  
  <pre><code>use strict; 
  use warnings;
  
  #change ID line name to random unique shorten (max 10 characters) string
  
  open (my $fh,"$ARGV[0]") or die "Failed to open file: $!\n";
  open (my $out_fh, "&gt;$ARGV[0]_shorten_ID.fasta");
  
  my $string;
  
  while(&lt;$fh&gt;) {
  
    for (0..9) { $string .= chr( int(srand(rand(25) + 65) )); }
  
    if ($_ =~ s/^&gt;*.+\n/&gt;$string/){  # change header FASTA header    
  
      print $out_fh "$_";
  
    }
  }
  
  close $fh;
  close $out_fh;
  </code></pre>
  
  <p>I have been trying this but it starts with 10 characters then adds 10 more on as goes down and I lose the sequence. I realize there are similar question already but it is slightly different, I need to randomly generate unique shortened names.</p>