title: perl unrar files
body: <p>I would like perl to unrar files from a folder I specify and after delete the rared files so they dont use HDD space. Files can be in this format: (r(ar|[0-9][0-9])|sfv)</p>
  
  <p>I have unrar installed and I`m new to PERL so please be specific if I need to add something somewhere. Like add this in top of the file and this there.</p>
  
  <p>My script now is like this:</p>
  
  <pre><code>while (1)
  {
    foreach (`find ${upload_folder}`)
    {
      chomp;
      if ($_ =~ /\.rar$/i)
        {
          $_=~/^([\W\w]+?)\/([^\/]+)$/;
          `rar x "$_" "$1"`;
          unlink($_);
        }
  #...
  }
  #...
  }
  </code></pre>
  
  <p>Thanks</p>
  
  <p>//Oh yeah and sometimes there can be a folder with multiple parts of rar file called .r01, .r02 .. .r50 and all those parts are actually 1 big rar file split up in many parts</p>