title: How do I convert a full path to a relative path using perl?
body: <p>I have the full path to a file and the full path to one of its parent directories in two variables in Perl program.  </p>
  
  <p>What is a safe way to calculate the relative path of the file relative to the parent directory. Needs to work on windows and unix.</p>
  
  <p>e.g.</p>
  
  <pre><code>$filePath = "/full/path/to/my/file";
  $parentPath = "/full";
  $relativePath = ??? # should be "path/to/my/file"
  </code></pre>