-2

The following code errors out:

 if (! defined $dchash{$location}) {
    die "Unrecognized realm: $location";
    }
 elsif ($dchash{$location}) ne $realm) {
    die "Incorrect realm for host in $location, expected $dchash{$location} got $realm";
    }

syntax error at ./test.pl line 73, near ") ne"
Execution of ./test.pl aborted due to compilation errors.

What is the proper syntax for verifying $realm is in the hash?

4

1 に答える 1

6

行の最初の)文字elsifが問題の原因です。これを削除すると、その構文エラーがなくなるはずです。

于 2012-12-07T00:22:26.347 に答える