Friday, 13 September 2013

slicing out multiples of nth element

slicing out multiples of nth element

I am having a list which has more than 10k elements . The problem is that
I need to remove all the multiples of 3rd element.
for example,
@testlists = qw (helloworld sessions first.cgi login localpcs
depthhashes.cgi search view macros plugins ...) ;
I want to remove only the first.cgi,depthhashses.cgi, macros (multiples of
3rd element) from original array. Grep function is little bit slower.
Please suggest me a faster grep search or any other similar subroutines .
Any help would be highly appreciated

No comments:

Post a Comment