title: Extract last K characters from a string in Perl
body: <p>I have a string that looks like this</p>
  
  <pre><code>my $str1 = "ACGGATATTGA";
  my $str2 = "alex";
  </code></pre>
  
  <p>What I want to do is to extract last three characters 
  from each of that.</p>
  
  <pre><code>$out1 = "TGA";
  $out2 = "lex";
  </code></pre>
  
  <p>How can I do it in Perl?</p>