Bug 5105 - Switch Module Depreciated in perl 12
Summary: Switch Module Depreciated in perl 12
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: rel_3_2
Hardware: All All
: PATCH-Sent (DO NOT USE) enhancement (vote)
Assignee: Colin Campbell
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-09 08:21 UTC by Colin Campbell
Modified: 2012-10-25 22:52 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed Patch (16.34 KB, patch)
2010-09-08 13:09 UTC, Colin Campbell
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Campbell 2010-08-09 08:21:00 UTC
Use of the Switch module is depreciated in perl 12 and above and generates warnings to that effect. Occurrences in the source should be replaced.

As 3.2 is compatible with perl 5.8.8 Switch would have to be replaced by an if/else construct. In future version of Koha (i.e. supporting 5.10 and greater only) the given/when syntax is available.
Comment 1 Zeno Tajoli 2010-08-09 13:12:30 UTC
But where can I see those warnings ?
Only in logs, I think.
So the work path that I suggest is:
3.0.x -> no changes
3.2 -> delete Switch, use ifs
3.4 -> start to use 'given' and 'when', insert perl 5.10 as a requirement.

Where I find use Switch:

$ grep -r 'use Switch' *

basket/downloadcart.pl:use Switch;
C4/Reports/Guided.pm:use Switch;
opac/opac-downloadcart.pl:use Switch;
opac/opac-detail.pl:use Switch;
opac/opac-downloadshelf.pl:use Switch;
tools/batchMod.pl:use Switch;
virtualshelves/downloadshelf.pl:use Switch;
Comment 2 Colin Campbell 2010-09-08 13:09:05 UTC
Created attachment 2604 [details] [review]
Proposed Patch
Comment 3 Chris Cormack 2010-11-10 22:34:24 UTC
Pushed to new/bug_5105

And merged to master, please test and close
Comment 4 Frédéric Demians 2010-11-11 08:16:38 UTC
Added a regression test:

http://lists.koha-community.org/pipermail/koha-patches/2010-November/012895.html
Comment 5 Chris Cormack 2010-11-12 02:46:17 UTC
Regression test pushed also