Old version gives defined(@array) is deprecated warnings

Bug #1549711 reported by Peter N Lewis
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
libmail-sender-perl (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The current packaged version of perl's Mail::Sender (0.8.16-2) is at least three years out of date of the current version (0.8.23) and generates several warnings when used due to the newer version of perl.

defined(@array) is deprecated at /usr/share/perl5/Mail/Sender.pm line 318.
 (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /usr/share/perl5/Mail/Sender.pm line 2693.
 (Maybe you should just omit the defined()?)

The package should be updated to the latest version.

Failing that, doing exactly as described (simply removing the "defined" on lines 318 and 2693 is how the newer version resolves the issue, so if there is some reason not to simply update the package, patching those lines would be good.

Description: Ubuntu 14.04.4 LTS
Release: 14.04

libmail-sender-perl:
  Installed: 0.8.16-2
  Candidate: 0.8.16-2
  Version table:
 *** 0.8.16-2 0
        500 http://mirrors.digitalocean.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

Tags: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libmail-sender-perl (Ubuntu):
status: New → Confirmed
Revision history for this message
Anders Ossowicki (aowi) wrote :

Also keep in mind that 16.04 ships with perl 5.22, where this warning is fatal[1], rendering the package completely broken there.

If upgrading the package is undesirable due to Ubuntu's policies, I've attached a patch with the fix as described by OP.

aowi@otto ~/src/libmail-sender-perl $ perl -MMail::Sender -e1
defined(@array) is deprecated at /usr/share/perl5/Mail/Sender.pm line 318.
 (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /usr/share/perl5/Mail/Sender.pm line 2693.
 (Maybe you should just omit the defined()?)
aowi@otto ~/src/libmail-sender-perl $ sudo dpkg -i libmail-sender-perl_0.8.16-2nz1_all.deb
[sudo] password for aowi:
(Reading database ... 310370 files and directories currently installed.)
Preparing to unpack libmail-sender-perl_0.8.16-2nz1_all.deb ...
Unpacking libmail-sender-perl (0.8.16-2nz1) over (0.8.16-2) ...
Setting up libmail-sender-perl (0.8.16-2nz1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
aowi@otto ~/src/libmail-sender-perl $ perl -MMail::Sender -e1
aowi@otto ~/src/libmail-sender-perl $

[1] http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#defined%28@array%29_and_defined%28%hash%29_are_now_fatal_errors

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-defined-array-warnings.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Geoff Goehle (goehle) wrote :

This bug should be upgraded to important. Xenial uses Perl 5.22 and the deprecation warnings have turned to fatal errors. Try

perl -MMail::Sender -e 1;

to see them. Upgrading to the latest version of Mail::Sender using cpan fixes the issue (for those who need it).

Revision history for this message
jamesarbrown (jamesarbrown1) wrote :

This breaks vacation.pl on Xenial since sys upgrade.

My only choice was to run cpan
and
"install Mail::Sender"

But even then there are deprecation warnings to use Email::Sender... which does not work with vacation.pl in postfix

Revision history for this message
Jean-Max Reymond (jmreymond-free) wrote :

very annoying bug. vacations in postfixadmin are broken and now, it is vacation time !
Don't understand why ubuntu do not upgrade to uptodate package

Revision history for this message
Jean-Max Reymond (jmreymond-free) wrote :

great patch from Anders Ossowicki and now, bug is fixed
thanks a lot

Revision history for this message
Josue Pirolo (jdredes) wrote :

Great Fix from Anders Ossowicki, Bug ix fixed. Thanks a lot.

Revision history for this message
ABCdatos (abcdatos) wrote :

Same problem in Ubuntu 20.04. If you update via cpan will get this:

perl -MMail::Sender -e 1;
Mail::Sender is deprecated and you should look to Email::Sender instead at -e line 0.

May be we must finally update our software to use Email::Sender.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.