in reply to map DBI results

As already pointed out, one problem is your choice of s/// delimiter, but I'd also leave out the map:
while (my @row = $sth->fetchrow_array) { s|$term|<i>$term</i>| for @row; ... }

Replies are listed 'Best First'.
Re^2: map DBI results
by Aristotle (Chancellor) on Dec 16, 2002 at 20:08 UTC
    s|$term|<i>$term</i>|
    Ugh, please don't advise people to use pattern metacharacters such as pipes as delimiters. You're opening a large can of worms. It may be fine for obfuscation, but is only inviting pain anywhere else.

    Makeshifts last the longest.