in reply to Matching multiple variables against array

Something like this?

my @form = map { $cgi->param("form$_") } 0..21; while (my $line = <DB>) { my @split_sp_data = split(/,/, $line); for my $i (0..21) { if (index($split_sp_data[$i], $form[$i]) >= 0) { print(qq(<a href="$split_sp_data[$i]">$split_sp_data[$i]</a>) +); } } }

index is faster than regexps when search for a static string (as opposed to a regexp).

Update: oops! Changed index(...) != 0 to index(...) >= 0. Thanks, InfiniteSilence.