Help for this page
.... if ($end > @result) { @result = @a[0..$end-1]; } ...
... if (--$end > @result) { @result = @a[0..$end]; } ...