in reply to New error message in ActivePerl 5.22
"defined(@array) and defined(%hash) are now fatal errors. These have been deprecated since v5.6.1 and have raised deprecation warnings since v5.16.".
I would do a grep on each file at a time for defined(@, verify what you get back is what you can do a global search and replace on, and do a s/defined(@/(@/g (in vi/vim: :%s/defined(@/(@/g. This will remove just the defined part, leaving just if (@array), which will check to see if there are any elements. Another way is to check defined on the first element: if (defined $array[0]).
update: defined $array[0] likely isn't a safe approach, as per a msg, the first element may be undefined, while latter elements may exist and be defined./update
Make a backup (or do a commit) before making any changes, so if things go downhill, you can revert the file back easily. After the global sweep, clean up any stragglers manually.
|
|---|