--- lib/TWiki/Contrib/DBCacheContrib/Array.pm 2007-10-08 12:27:38.000000000 +0200 +++ lib/TWiki/Contrib/DBCacheContrib/Array.pm 2007-10-08 12:29:05.000000000 +0200 @@ -79,6 +79,24 @@ =begin text +---+++ =findstr($str)= -> integer + * $str datum of the same type as the content of the array +Uses "eq" to find the given element in the array and return it's index (-1 if it fails) + +=cut + +sub findstr { + my ( $this, $str ) = @_; + my $i = 0; + foreach my $elm ( @{$this->{values}} ) { + return $i if ( $elm eq $str ); + $i++; + } + return -1; +} + +=begin text + ---+++ =remove($index)= * =$index= - integer index Remove an entry at an index from the array.