in reply to Re^2: can you please fix the error
in thread can you please fix the error

You're still pushing $word onto @lessWords regardless of the match. Simple fix:
foreach $word (@data) { my @arr=split(/ /,$word); WORD: foreach $a (@arr) { foreach $stop (@stopwords) { next WORD if $a eq $stop; } push(@lessWords, $word); } }
using a hash for @stopwords would make this code simpler and faster, though. There are some examples in this thread somewhere.

update: the above code is still buggy. See below for a much simpler version that should work.

Replies are listed 'Best First'.
Re^4: can you please fix the error
by zulqernain (Novice) on Jun 01, 2005 at 18:01 UTC
    it did not work either ...it just put the same text many a times ...does not remove the stopwords :(