supernono06 has asked for the
wisdom of the Perl Monks concerning the following question:

Hi everybody,
I am a beginner and I need your help.
I use Windows 10. I have an old perl script which was perfectly running using Perl 5.6.1.635.
Now I have installed Strawberryperl 5.28.0.1 and I get an error message:
"Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at ucode.pl line 4191."
In my script (ucode.pl), this corresponds to the following line:
"if (defined %function_array_name) {"
Can you please explain me the meaning of this error and guide me how to fix it?
Thanks. Supernono06

Hello supernono06 and welcome to the monastery and to the wonderful world of Perl!

You can also profit the read of the main documentation for defined especially:

Use of defined on aggregates (hashes and arrays) is no longer supporte+d. It used to report whether memory for that aggregate had ever been +allocated. You should instead use a simple test for size:
if (@an_array) { print "has array elements\n" }
if (%a_hash) { print "has hash members\n" }

$ 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.