Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing switch.pm - Active Perl x64/windows

I have installed Active Perl (v5.14.2, 64-bit, for Windows) and my code containing use Switch; started to fail with the error Can't locate Switch.pm in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64/lib .) at myfilename.pl line 3..

Copying switch.pm over from an older 32-bit installation fixed the problem, but I don't understand it. Has switch.pm been deprecated in the meantime?

like image 599
Alexey Frunze Avatar asked Apr 28 '12 03:04

Alexey Frunze


People also ask

Where is active Perl installed?

Perl is installed by default in C:\Perl . The default drive " C " selected will be the same drive that the operating system is installed on, or the drive that has the largest amount of space available.


1 Answers

It was replaced with given/when:

Starting from Perl 5.10, you can say

use feature "switch";

which enables a switch feature that is closely based on the Perl 6 proposal.

See also Deprecations in perl5101delta:

The following items are now deprecated.

Switch is buggy and should be avoided. From perl 5.11.0 onwards, it is intended that any use of the core version of this module will emit a warning, and that the module will eventually be removed from the core (probably in perl 5.14.0).

If you have legacy code that uses Switch.pm, it's still available on CPAN.

like image 94
Sinan Ünür Avatar answered Oct 01 '22 16:10

Sinan Ünür