in reply to Re: Code challenge: array subrange
in thread Code challenge: array subrange
sub r {$_[0]..$_[1],reverse(pop..pop)} sub array_range { $h=pop; @rel{ r@{ $h->{range} } } = @{ $h->{arr} }; [grep { defined() ? $_ : die "out of range" } @rel{ r@{ $h->{subra +nge}} }]; }
|
|---|