in reply to Re: Re: Re: Re: Useful uses of Quantum::Superpositions?
in thread Useful uses of Quantum::Superpositions?

It will be the same as saying any(2..11).

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Useful uses of Quantum::Superpositions?
by feanor_269 (Beadle) on Apr 09, 2003 at 19:40 UTC
    You mean it'll DWIM? Cool... still not sure it's that useful tho...

    feanor_269

      Sure its useful. Over at id:249381 I had to create a short function indexany() for use in the grep. If @searchCriteria were actually a disjunction then this code doesn't require the new function anymore.

      # Without disjunctions sub indexany { -1 != index $_, $_[0] and return 1 for @_[1 .. $#_]; re +turn 0 } @newArray = grep indexany($_, @searchCriteria), @largeArray # With disjunctions $searchCriteria = any( @searchCriteria); @newArray = grep -1 != index($_, $searchCriteria), @largeArray;

      That depends on what you mean ;-)