title: Compute all possible sequences up to a given length
body: <p>My question relates to bioinformatics, specifically protein sequences however, no biological knowledge is really needed. I am trying to find an efficient way of solving this problem in Perl:</p>
  
  <p>Protein sequences are basically sequences or strings which vary in length and are composed of combinations of 20 amino acids or characters.</p>
  
  <p>At a length of 1, there would be thus 20 possibilities. The issue is that with every increment of 1 character, the number of possibilities increases substantially. </p>
  
  <p>I wanted to compute another calculation on every sequence of every length. Protein sequences can be many hundreds and even thousands of amino acids. I just need to get all the possible sequences to do this.</p>
  
  <p>edit: I realise that it is impossible to compute for every length, I do not need to do this, but I wanted to do it for a sensible length that would not take anywhere near the length of the universe.</p>
  
  <p>Any suggestions on the most efficient way to code this?</p>
  
  <p>edit: I do not really need to do this for sequences of 1000, I was just interested on ideas, resources, functions etc that I am not aware of that may help me understand the most efficient way to do this. </p>