I have the full path to a file and the full path to one of its parent directories in two variables in Perl program.
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.
e.g.
$filePath = "/full/path/to/my/file";
$parentPath = "/full";
$relativePath = ??? # should be "path/to/my/file"
Use File::Spec
They have a abs2rel function
Will work on both Windows and Linux