title: Generate word from list of characters
body: <p>I asked <a href="https://stackoverflow.com/questions/58851453/generate-all-combinations-from-list-of-characters">this question</a> and I realized I was asking the question incorrectly, though the answer @Zdim provided is exactly what I asked: So now I need to change that question a bit.</p>
  
  <pre><code>my $str = 'aaaa';
  print $str++, $/ while $str le 'dddd';
  </code></pre>
  
  <p>So the above code does each combination from <code>aaaa</code> to <code>dddd</code> for instance:</p>
  
  <pre><code>aaaa
  aaab
  aaac
  ...
  daaa
  ...
  dddd
  </code></pre>
  
  <p>However, we need to generate <strong>all</strong> the possible combinations of a given set of the given characters. whether they are numeric, special characters or alphabetical characters. So If I tell the script the minimum <code>2</code> and maximum is <code>4</code> letter words and I give an input string of:</p>
  
  <pre><code>abcdefG1234%#@
  </code></pre>
  
  <p>it will then generate:</p>
  
  <pre><code>aa
  aaa
  aaaa
  bb
  aaab
  bbbb
  @@@@
  abc@
  ab@1
  ...
  </code></pre>
  
  <p>So it should use each of the characters and create each possible combination from minimum <code>2</code> characters to maximum <code>4</code> characters.</p>
  
  <p>So even if I give the entire alphanumeric and special characters, it will create each possible word or string within the range of <code>2</code> to <code>4</code> characters.</p>
  
  <p>If We take this <code>glob</code> example, it is close, but it will only do all the sets of 4, not all combinations from <code>2</code>, then <code>3</code> and then <code>4</code></p>
  
  <pre><code>print, while glob '{A,B,C,D,#,@,a,d,e,f}'x4
  </code></pre>