[ZBX-3929] Switch.pm being deprecated, used in gen.pl Created: 2011 Jul 07 Updated: 2017 May 30 Resolved: 2012 Apr 12 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Installation (I) |
Affects Version/s: | None |
Fix Version/s: | 1.8.13rc1, 2.0.0rc3 |
Type: | Incident report | Priority: | Minor |
Reporter: | richlv | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | compilation | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Description |
gen.pl, used in "make dbschema" step, uses Switch. Switch.pm was a core perl module, which is in the process of being removed. from http://stackoverflow.com/questions/844616/obtain-a-switch-case-behaviour-in-perl-5 : "Furthermore, Switch.pm will be the first Perl module ever to be removed from the perl core. The next major release of perl, 5.12.0, will still have it, albeit with a deprecation warning. That deprecation warning will go away if you explicitly install Switch.pm from CPAN. (You get what you ask for.) In the next release down the road, 5.14, Switch.pm will be entirely removed from core." some distributions already contain perl 5.14, and gen.pl does not work on them without installing additional modules. it should be updated so that it only uses Switch.pm on perl < 5.12 |
Comments |
Comment by richlv [ 2012 Apr 11 ] |
apparently, since perl 5.10 there's a "given/when" statement, so maybe a version check of >= 5.10 could use the new statement, if older - use the current one... |
Comment by Alexander Vladishev [ 2012 Apr 12 ] |
Fixed in the development branches |
Comment by dimir [ 2012 Apr 13 ] |
Successfully tested. Please review my changes in r26808, r26822 and r26823. I propose to 'use strict' and enable warnings in all Perl scripts. Example reference: http://perl.about.com/b/2006/09/21/why-you-should-use-strict.htm If we agree on that we should probably add this information to code guidelines. (1) Please fix a lot of "Use of uninitialized value" warnings. <dimir> RESOLVED in r26837 |
Comment by dimir [ 2012 Apr 13 ] |
Added Perl conventions to enable warnings and use strict pragma: http://www.zabbix.org/wiki/Docs/specs/coding_style#Perl_conventions |
Comment by Alexander Vladishev [ 2012 Apr 13 ] |
Fixed in version pre-1.8.13rc1 r27062 and pre-2.0.0rc3 r26842. |