Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

(jeffa) Re: map DBI results

by jeffa (Bishop)
on Dec 16, 2002 at 15:20 UTC ( #220234=note: print w/replies, xml ) Need Help??


in reply to map DBI results

map evalutes the last expression, so you are returning the number of substitions found by s///. Try this instead:
while (my @row = map { s/$term/"<i>$term<\/i>"/; $_ } $sth->fetchrow_a +rray()) {
You also need to escape the slash in </i>. Check out Map: The Basics for more examples on map.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://220234]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-12-13 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (378 votes). Check out past polls.

    Notices?