in reply to effect of Switch module on DATA

The Switch module is most definitely not a core Perl module (see index-modules-S.) Moreover, the CPAN Tester’s Matrix shows that the latest version (2.16) doesn’t install on any version of Perl later than 5.13.3, on any platform.

So yes,

use feature 'switch';

instead.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: effect of Switch module on DATA
by tobyink (Canon) on Aug 23, 2013 at 09:15 UTC

    It was a core module between 5.7.3 and 5.13.1.

    However, it's a source filter, and was thus broken from the start. Its inclusion in core is widely considered to have been an awful, awful mistake.

    For what it's worth, use feature 'switch' will also warn on the latest Perls because p5p is planning on making major changes to that feature (or perhaps dropping it entirely) in the near future.

    So the choices are: if/elsif/else, dispatch tables, CPAN (Switch, Switch::Plain, etc), or use feature 'switch' while keeping a close eye on development releases of Perl.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name"