In what way is `fast_abs_path` "dangerous, but potentially faster"?
perl
Solution
`fast_abs_path` invokes `chdir` to have the kernel resolve the path leading up to what you passed it all at once, instead of carefully checking each component and building a new path piece by piece; the problem is that it is possible that permissions would prevent it from `chdir`ing back to the original directory afterward. (Some systems can use `open` and `fchdir` to get around this, but it's not reliably available on all platforms where Perl runs.)
Whether this can even occur depends on whether it is possible for your script to execute in a directory which it would not be able to access directly. On Unix-like systems this can happen when a setuid wrapper `chdir`s to a restricted permissions area and then drops the setuid. (Historically the restricted permissions are on a path component named `lock`; various mail and Usenet news subsystems have used this to protect their queue directories.)
Problem
The documentation for the Cwd module states that `fast_abs_path` is a "more dangerous, but potentially faster version of `abs_path`". In what way is it dangerous? Under what circumstances is it faster? Does the behavior vary by platform?