MT-Notifier defined (%hash) is deprecated error?

Alert (and long-time) MT-Notifier user Scott Yoshinaga - yes, from nemu*nemu - mentioned an error that he had been seeing when trying to execute the queue script for MT-Notifier.

The specific error he was getting, I believe with Movable Type 4.38, was:

6/7/12 6:20:49.831 AM com.mt-notifier-queue: defined(%hash) is deprecated at /opt/local/apache2/cgi-bin/mt/extlib/Locale/Maketext.pm line 404.
6/7/12 6:20:49.831 AM com.mt-notifier-queue: (Maybe you should just omit the defined()?)

Unfortunately it is not specific to MT-Notifier (or the queue), but it is a problem that seems to have a fairly simple fix.

The problem stems from the fact that Perl 5.1 (possibly 5.12) has deprecated the use of defined with arrays and hashes - and the Maketext module referenced is using them on both a hash and an array.

Taking a look at line 404, you will see this:

if defined(%{$module . '::Lexicon'}) or defined(@{$module . '::ISA'});

Changing it to this:

if (%{$module . '::Lexicon'}) or (@{$module . '::ISA'});

Seems to clear up the problem. As always, back up your files before making changes. You could also try and download a new version of the Maketext.pm module, but you may also need to update other modules that depend on it, so this could be the fastest change needed. Hopefully it will help you, since this will impact more than just MT-Notifier.

Leave a comment

Recent Entries

A New Approach to Fighting Spam
Drew asks if MT-Approval has been updated to work with MT5 - specifically version 5.14, but since version 5.2 was…
Adventures with Joomla!
One of my longtime customers, Craig Reid, recently inquired if I could help with an issue his parents were having…
MT-Notifier defined (%hash) is deprecated error?
Alert (and long-time) MT-Notifier user Scott Yoshinaga - yes, from nemu*nemu - mentioned an error that he had been seeing…