title: How should we split a string in perl and store it in two variables
body: <p>how can we split the following string in perl:</p>
  
  <p>Input:</p>
  
  <pre><code>$string='/path/to/the/file/on/server/date_in_yyyymmdd/filename-yyyymmdd.tar.gz'
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>$string1=/path/to/the/file/on/server/date_in_yyyymmdd
  $string2=filename-yyyymmdd.tar.gz
  </code></pre>