Reputation: 337
Is there any way to run scripts that includes switch
statement with Perl 5.14?
I have many scripts that use switch statement, I do not want to run them on other perl's version. What should I do?
Upvotes: 1
Views: 2652
Reputation: 132858
I think you should rewrite the code that uses the deprecated and unsupported code and run everything else on an older perl
until you've finished that. You can install the deprecated and unsupported module on a supported perl
, but there's no guarantee that it's tricks will work anymore.
Upvotes: 3
Reputation: 7526
Prior to 5.10 there was a Switch module. This is deprecated at 5.10 and replaced by a given-when
syntax. This FAQ describes it well.
The Switch
module appeared in the core in 5.7.3 but was removed in 5.13.1
Upvotes: 7