in reply to Better way to do this

  1. Add -w & use strict and fix the ~20 errors and warnings produced.

    It won't change anything, but people might take your code more seriously.

  2. Remove the reverse.

    It serves no purpose beyond obfuscation.

  3. Then you could try explaining what the output means.

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 knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Better way to do this
by PetreAdi (Sexton) on Feb 20, 2016 at 19:49 UTC

    Works fine for me but it is very slow

    I need a faster way

      I need a faster way

      Well. The easiest way to make code run faster, is to avoid doing things that don't need need to be done.

      Reverseing an element array doesn't take very long, but since it makes no difference to the program, why bother.

      I think that there are two or three things that could be changed to speed things up, one by a substantial amount; if I've correctly guessed the purpose of your code.

      But since you seem reluctant explain the logic of your code, I've no way to assess the possibilities one way or another.


      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 knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Given two arrays @unique and @in, find the index, @idxs into @unique of the element of @in

        I want to return each elements which between two consecutive indexes (@idxs) if 10< Length > 5.