in reply to Select value from array w/o replacement (or destroying the array)

My suggestion is to use hash:

my %already_selected; ...... unless ( $already_selected{$find} ) { $already_selected{$find}++; #this number is selecting first time .... }

And of course don't use splice if you don't want destroy original array.

  • Comment on Re: Select value from array w/o replacement (or destroying the array)
  • Download Code