mrguy123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks, say I want to compare a number to several ranges using given. I think in Perl6 it's supposed to look like this:
Thanks, Mister Guy
Solved -thanks for the help. Am now trying to discover how "safe" using given/when is (as of Perl 5.18, given/when has been marked experimental and issues warnings because it may undergo major changes in a future version of Perl)
Any idea how to do it in 5.10?given( $x ){ when 2..5 { } when 6..10 { } default{ } }
Thanks, Mister Guy
Solved -thanks for the help. Am now trying to discover how "safe" using given/when is (as of Perl 5.18, given/when has been marked experimental and issues warnings because it may undergo major changes in a future version of Perl)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: range comparison in given
by tobyink (Canon) on Jul 10, 2013 at 10:40 UTC | |
by mrguy123 (Hermit) on Jul 10, 2013 at 10:45 UTC | |
by tobyink (Canon) on Jul 10, 2013 at 15:35 UTC | |
by ww (Archbishop) on Jul 10, 2013 at 13:58 UTC | |
Re: range comparison in given
by Lotus1 (Vicar) on Jul 10, 2013 at 14:21 UTC | |
Re: range comparison in given
by kcott (Archbishop) on Jul 11, 2013 at 07:53 UTC |
Back to
Seekers of Perl Wisdom