Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi cheselton, The easiest way to get rid of the warning on all Perls v5.10 and above is the following, taken from here, which also briefly explains the rationale for making it experimental:
And I think the best way to enable the smartmatch feature is use 5.010_001; (see "Feature Bundles" and the section following it, "Implicit Loading"). I suggest Perl v5.10.1 because there were some significant changes to the way smartmatching and given/when works. Update: I should add that because of its experimental state and the fact that the behaviour might change later, I now avoid given/when and use if/elsif or one of the other alternatives like dispatch tables instead. In fact, I sometimes begin Perl scripts with the somewhat clumsy use 5.010; no feature 'switch'; when I want to have v5.10 as my minimum version but want to avoid accidentally using given/when. There's also been several discussions here on PerlMonks, for example Bring back the smartmatch operator (but with sane semantics this time)!, which includes this post listing some of the alternatives available on CPAN. Hopefully we will get back a working given/when someday :-) Hope this helps, Update: Expanded post slightly. Yet Another Update: Used ge rather than >= as explained here. In reply to Re: Best option for "switch/case" functionality?
by haukex
|
|