In UNIX, we sometimes have softlinks to path. This has caused the path checking using pattern mathching is insufficient.
After much workarounds in my codes, finally, I found this. I just get the absolute path from the 2 given paths, then make comparison.
use Cwd 'abs_path'; if (abs_path($path1) eq abs_path($path2)) { ... ... }
:)
No comments:
Post a Comment