Re: separating an array into sets of n elements

2001-09-26 Thread birgit kellner
--On Dienstag, 25. September 2001 15:44 -0800 Michael Fowler <[EMAIL PROTECTED]> wrote: > It would? Your variables are off by one. Element 2 in @hitsarray is > 'the', not 'is'. $fieldnumber is set to 4, but you clearly have > groupings of 5 words: true; apologies for late night sloppiness.

Re: separating an array into sets of n elements

2001-09-25 Thread Michael Fowler
On Wed, Sep 26, 2001 at 12:49:43AM +0200, birgit kellner wrote: > my @hitsarray = qw(this is the first hit this is the second hit this is the > third hit); > my $fieldnumber = "4"; > my $searchposition = "2"; > I want to know whether @hitsarray contains two sets of $fieldnumber > elements where

separating an array into sets of n elements

2001-09-25 Thread birgit kellner
my @hitsarray = qw(this is the first hit this is the second hit this is the third hit); my $fieldnumber = "4"; my $searchposition = "2"; I want to know whether @hitsarray contains two sets of $fieldnumber elements where the string at $searchposition is identical - in this example, that would be