in reply to Verifying Current Working Directory: getcwd() and absolute path

Cwd also exports (on request) a method called abs_path, which will convert a symlink to the real path. You could use this for your comparison, ie:

use Cwd qw(abs_path getcwd); if (abs_path('/home') eq getcwd) { print "Correct directory\n"; # do whatever needs to be done }

Of course, substitute your symlinked path for /home in the above