in reply to Oh ye who are in the gall of perlness...what maketh me mistaketh :)
Along the same lines, doing if ("$pwd" eq "$directory") { also does too much string interpolation. Just do if ($pwd eq $directory) {.
Now the problem you're having is that you're saying if the two variables are string-wise equivalent, complain that you're not in the same directory, otherwise say that you are. You probably wanted one of the following:
unless ($pwd eq $directory) {
or
if ($pwd ne $directory) {
That should fix your problem.
|
|---|