Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Oh ye who are in the gall of perlness...what maketh me mistaketh :)

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:
unless ($pwd eq $directory) {
or
if ($pwd ne $directory) {

That should fix your problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://73683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-24 20:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found