Why are some of my ranges insane?
问题 I tried parsing a common string depiction of ranges (e.g. 1-9 ) into actual ranges (e.g. 1 .. 9 ), but often got weird results when including two digit numbers. For example, 1-10 results in the single value 1 instead of a list of ten values and 11-20 gave me four values ( 11 10 21 20 ), half of which aren't even in the expected numerical range: put get_range_for('1-9'); put get_range_for('1-10'); put get_range_for('11-20'); sub get_range_for ( $string ) { my ($start, $stop) = $string.split('-