go ahead... be a heretic | |
PerlMonks |
Re: Oh ye who are in the gall or perlness...what maketh me mistaketh :)by satchboost (Scribe) |
on Apr 19, 2001 at 02:16 UTC ( [id://73683]=note: print w/replies, xml ) | Need Help?? |
My first response is that you should simply be doing
test($sandbox);, not test("$sandbox");. That isn't going to make a difference here, but my $directory = "@_"; makes me cringe. Doing my ($directory) = @_; would seem to be more standard.
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: That should fix your problem.
In Section
Seekers of Perl Wisdom
|
|