in reply to problem using new perl version
Hi, you can often get more information with diagnostics:
$ perl -Mstrict -Mdiagnostics -wE 'my %foo; say 1 if defined %foo' Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) + at -e line 1 (#1) (F) defined() is not usually right on hashes. Although defined %hash is false on a plain not-yet-used hash, it becomes true in several non-obvious circumstances, including itera +tors, weak references, stash names, even remaining true after undef %has +h. These things make defined %hash fairly useless in practice, so it +now generates a fatal error. If a check for non-empty is what you wanted then just put it in bo +olean context (see "Scalar values" in perldata): if (%hash) { # not empty } If you had defined %Foo::Bar::QUUX to check whether such a package variable exists then that's never really been reliable, and isn't a good way to enquire about the features of a package, or whether it's loaded, etc. Uncaught exception from user code: Can't use 'defined(%hash)' (Maybe you should just omit the defined +()?) at -e line 1.
Hope this helps!
|
|---|