title: Print numbers, upper-lower case letters separately in perl
body: <p>I have a list like:</p>
  
  <pre><code> DD2aaQQmmm
   AA34DDmm
  </code></pre>
  
  <p>And i want to print the upper case, the lower case and the numbers separately, so it would be like:</p>
  
  <pre><code>DDQQ aammm 2
  AADD mm 34
  </code></pre>
  
  <p>How should I do this in perl, using regex?</p>
  
  <p>I have tried for the upper case this: </p>
  
  <pre><code>#!/usr/bin/perl
  
  my @array = &lt;&gt;;
  chomp(@array);
  
  foreach (@array){
      if ($_ = ~ /([A-Z][a-z])/){
          print $_ "\n"
      }
  }
  </code></pre>
  
  <p>But this only prints out the words starts with upper case.</p>