3

I am trying this code and get an error when running it.

   $cfg->{'validRules'} = "true"
...


if ($cfg->{'validRules'} eq "true") { <== error is pointing to this
}

Error is

Error: Can't use string ("0") as a HASH ref while "strict refs" in use at

I am totally clueless. I tried changing it but still the same. Appreciate if I can get some help.

4

1 回答 1

4

你做了相当于

$cfg = 0;

在某一点。这显然会使

$cfg->{'validRules'}

失败。找到您分配零的位置$cfg并修复它。

于 2013-01-13T06:05:45.200 回答