* Sven Neuhaus <[EMAIL PROTECTED]> [2005-05-09 10:35]: > @a = $x =~ /word1|word2|word3/g; > $count = scalar @a;
The problem with this and all the grep solutions is that you donât know whether you matched the same alternate multiple times, or matched different alternates. You donât know whether the result is "2" because the string was "word1word1" (which should be rejected) or "word1word2" (which we want to accept). Regards, -- #Aristotle *AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}; &Just->another->Perl->hacker;