in reply to Comparing two directories and then exiting from the script

Neither of your arguments are numeric. Just use ne:
if ($client_root ne $cwd) { #do something }