Closed Bug 914963 Opened 6 years ago Closed 6 years ago

Warning from perl interpreter.: defined(@array) is deprecated at mozilla/config/milestone.pl line 58.

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla27

People

(Reporter: ishikawa, Assigned: rillian)

Details

Attachments

(1 file)

I recently upgraded my PC&s perl package (Debian GNU/Linux) to
the following version:

 perl --version

This is perl 5, version 18, subversion 1 (v5.18.1) built for x86_64-linux-gnu-thread-multi
(with 45 registered patches, see perl -V for more detail)

Copyright 1987-2013, Larry Wall
  [... rest omitted ...]

Now when I run mozilla/mach to build thunderbird,
I get the following warning.
It seems perl deprecates the particular construct in the newer version.
The message is printed at different stages: I saw three of them.

2:58.09 defined(@array) is deprecated at /COMM-CENTRAL/comm-central/mozilla/config/milestone.pl line 58.
2:58.09 	(Maybe you should just omit the defined()?)

I will defer the proper change to the people in the know.

TIA
Product: Thunderbird → Core
Summary: Warning from perl interpreter.: defined(@array) is deprecated at /COMM-CENTRAL/comm-central/mozilla/config/milestone.pl line 58. → Warning from perl interpreter.: defined(@array) is deprecated atmozilla/config/milestone.pl line 58.
Summary: Warning from perl interpreter.: defined(@array) is deprecated atmozilla/config/milestone.pl line 58. → Warning from perl interpreter.: defined(@array) is deprecated at mozilla/config/milestone.pl line 58.
This warning has been annoying me too. To quote http://perldoc.perl.org/perldiag.html

"defined() is not usually useful on arrays because it checks for an undefined scalar value. If you want to see if the array is empty, just use if (@array) { # not empty } for example."

My patch changes the check as suggested.
Assignee: nobody → giles
Attachment #822006 - Flags: review?(gps)
Adding Dão who touched the file most recently.
Comment on attachment 822006 [details] [diff] [review]
Remove suprious defined(@array)

Review of attachment 822006 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you.
Attachment #822006 - Flags: review?(gps) → review+
Thank you. A few less lines to read with puzzled look :-)
https://hg.mozilla.org/mozilla-central/rev/f94365dffb6f
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
The impact of this bug is beyond just a spurious warning. On esr24, my Thunderbird mach refuses to run at all until this patch is applied.

I'll live with this and apply it manually, but if others have this issue we might want to backport this.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.