in reply to Specifying a range of indices via the command line

BTW: Your testcode can be simplified also:

my $maxind = 10; print "maxind=$maxind\n"; for my $rstr ( qw[ x 1-2-3 0 10 11 4 4-6 7- -2 -10 -11 -0 10- 11- ] ) + { my @ret = eval{ range_to_list( $maxind, $rstr ) }; print "rstr:$rstr:", $@ ? "...exc:$@" : "...ret:@ret:"; } my @apples = qw[ :zero: :one: :two: :three: :four: ]; print "apples ", @apples[range_to_list( $#apples, "1-3" )], "\n";

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked