in reply to map DBI results
You also probably want to escape pattern metacharacters in $term (s!\Q$term!"<i>$term</i>"!, perldoc -f quotemeta), and it might help to precompile the pattern:while (my @row = $sth->fetchrow_array()) { s!$term!"<i>$term</i>"! for @row; # ... }
my $rx = qr/\Q$term/; while (my @row = $sth->fetchrow_array()) { s!$rx!"<i>$term</i>"! for @row; # ... }
Makeshifts last the longest.
|
|---|